diff options
author | Jim Meyering <jim@meyering.net> | 1999-01-02 19:29:47 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1999-01-02 19:29:47 +0000 |
commit | 1e25b6e3d3608549b46f55624e8111f48d916f2f (patch) | |
tree | 94d5dc3434b862e241ca9685be889cfd2274b3a9 | |
parent | 38acb920ebf02351792fc0b046f32a32ad3e710a (diff) | |
download | coreutils-1e25b6e3d3608549b46f55624e8111f48d916f2f.tar.xz |
Adapt to use new interface to XARGMATCH.
-rw-r--r-- | src/cp.c | 6 | ||||
-rw-r--r-- | src/ls.c | 32 | ||||
-rw-r--r-- | src/touch.c | 10 |
3 files changed, 28 insertions, 20 deletions
@@ -1,5 +1,5 @@ /* cp.c -- file copying (main routines) - Copyright (C) 89, 90, 91, 95, 96, 97, 1998 Free Software Foundation. + Copyright (C) 89, 90, 91, 95, 96, 97, 1998, 1999 Free Software Foundation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -655,8 +655,8 @@ main (int argc, char **argv) break; case CHAR_MAX + 1: - x.sparse_mode = XARGMATCH ("--sparse", optarg, - sparse_type_string, sparse_type); + XARGMATCH (&x.sparse_mode, "--sparse", optarg, + sparse_type_string, sparse_type, usage (1)); break; case 'a': /* Like -dpR. */ @@ -1,5 +1,5 @@ /* `dir', `vdir' and `ls' directory listing programs for GNU. - Copyright (C) 85, 88, 90, 91, 95, 96, 97, 1998 Free Software Foundation, Inc. + Copyright (C) 85, 88, 90, 91, 95, 96, 97, 1998, 1999 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -78,6 +78,9 @@ #define obstack_chunk_alloc malloc #define obstack_chunk_free free +#define MY_XARGMATCH(Result_ptr, Msg, Arg, Arg_list, Val_list) \ + XARGMATCH (Result_ptr, Msg, Arg, Arg_list, Val_list, usage (1)) + /* Return an int indicating the result of comparing two integers. Subtracting doesn't always work, due to overflow. */ #define longdiff(a, b) ((a) < (b) ? -1 : (a) > (b)) @@ -1099,22 +1102,20 @@ decode_switches (int argc, char **argv) break; case 10: /* --sort */ - sort_type = XARGMATCH ("--sort", optarg, sort_args, sort_types); + MY_XARGMATCH (&sort_type, "--sort", optarg, sort_args, sort_types); break; case 11: /* --time */ - time_type = XARGMATCH ("--time", optarg, time_args, time_types); + MY_XARGMATCH (&time_type, "--time", optarg, time_args, time_types); break; case 12: /* --format */ - format = XARGMATCH ("--format", optarg, - format_args, format_types); + MY_XARGMATCH (&format, "--format", optarg, format_args, format_types); break; case 13: /* --color */ if (optarg) - i = XARGMATCH ("--color", optarg, - color_args, color_types); + MY_XARGMATCH (&i, "--color", optarg, color_args, color_types); else /* Using --color with no argument is equivalent to using --color=always. */ @@ -1134,16 +1135,19 @@ decode_switches (int argc, char **argv) break; case 14: /* --indicator-style */ - indicator_style = XARGMATCH ("--indicator-style", optarg, - indicator_style_args, - indicator_style_types); + MY_XARGMATCH (&indicator_style, "--indicator-style", optarg, + indicator_style_args, + indicator_style_types); break; case 15: /* --quoting-style */ - set_quoting_style (NULL, - XARGMATCH ("--quoting-style", optarg, - quoting_style_args, - quoting_style_vals)); + { + enum quoting_style qs; + MY_XARGMATCH (&qs, "--quoting-style", optarg, + quoting_style_args, + quoting_style_vals); + set_quoting_style (NULL, qs); + } break; case 16: diff --git a/src/touch.c b/src/touch.c index f9ea43a06..6f24d9f4c 100644 --- a/src/touch.c +++ b/src/touch.c @@ -1,5 +1,5 @@ /* touch -- change modification and access times of files - Copyright (C) 87, 89, 90, 91, 95, 96, 97, 1998 Free Software Foundation, Inc. + Copyright (C) 87, 1989-1991, 1995-1999 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -285,8 +285,12 @@ main (int argc, char **argv) break; case CHAR_MAX + 1: /* --time */ - change_times |= XARGCASEMATCH ("--time", optarg, - time_args, time_masks); + { + int mask; + XARGMATCH (&mask, "--time", optarg, time_args, time_masks, + usage (1)); + change_times |= mask; + } break; default: |