diff options
author | Jim Meyering <jim@meyering.net> | 1992-12-02 18:55:36 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1992-12-02 18:55:36 +0000 |
commit | 57e56eb7ecaf708b248af8faebd972a0ce6f03c1 (patch) | |
tree | c3f0b50cb23033a9f68ae740fc6b41549eb46cc7 | |
parent | f6ae65319a4e34bb6aebdc8dd4b12e9df136d690 (diff) | |
download | coreutils-57e56eb7ecaf708b248af8faebd972a0ce6f03c1.tar.xz |
Convert static declarations of struct option to use new macros from
getopt.h: no_argument, required_argument, and optional_argument.
-rw-r--r-- | src/chgrp.c | 10 | ||||
-rw-r--r-- | src/chown.c | 10 | ||||
-rw-r--r-- | src/cp.c | 30 | ||||
-rw-r--r-- | src/df.c | 10 | ||||
-rw-r--r-- | src/du.c | 20 | ||||
-rw-r--r-- | src/install.c | 10 | ||||
-rw-r--r-- | src/ln.c | 16 | ||||
-rw-r--r-- | src/ls.c | 46 | ||||
-rw-r--r-- | src/mkdir.c | 4 | ||||
-rw-r--r-- | src/mkfifo.c | 2 | ||||
-rw-r--r-- | src/mknod.c | 2 | ||||
-rw-r--r-- | src/mv.c | 14 | ||||
-rw-r--r-- | src/rm.c | 10 | ||||
-rw-r--r-- | src/rmdir.c | 2 | ||||
-rw-r--r-- | src/touch.c | 8 |
15 files changed, 97 insertions, 97 deletions
diff --git a/src/chgrp.c b/src/chgrp.c index 9b178eac7..57904ac49 100644 --- a/src/chgrp.c +++ b/src/chgrp.c @@ -66,11 +66,11 @@ static char *groupname; static struct option const long_options[] = { - {"recursive", 0, 0, 'R'}, - {"changes", 0, 0, 'c'}, - {"silent", 0, 0, 'f'}, - {"quiet", 0, 0, 'f'}, - {"verbose", 0, 0, 'v'}, + {"recursive", no_argument, 0, 'R'}, + {"changes", no_argument, 0, 'c'}, + {"silent", no_argument, 0, 'f'}, + {"quiet", no_argument, 0, 'f'}, + {"verbose", no_argument, 0, 'v'}, {0, 0, 0, 0} }; diff --git a/src/chown.c b/src/chown.c index b510f1228..37a881e2f 100644 --- a/src/chown.c +++ b/src/chown.c @@ -83,11 +83,11 @@ static char *groupname; static struct option const long_options[] = { - {"recursive", 0, 0, 'R'}, - {"changes", 0, 0, 'c'}, - {"silent", 0, 0, 'f'}, - {"quiet", 0, 0, 'f'}, - {"verbose", 0, 0, 'v'}, + {"recursive", no_argument, 0, 'R'}, + {"changes", no_argument, 0, 'c'}, + {"silent", no_argument, 0, 'f'}, + {"quiet", no_argument, 0, 'f'}, + {"verbose", no_argument, 0, 'v'}, {0, 0, 0, 0} }; @@ -119,21 +119,21 @@ static uid_t myeuid; static struct option const long_opts[] = { - {"archive", 0, NULL, 'a'}, - {"backup", 0, NULL, 'b'}, - {"force", 0, NULL, 'f'}, - {"interactive", 0, NULL, 'i'}, - {"link", 0, NULL, 'l'}, - {"no-dereference", 0, &flag_dereference, 0}, - {"one-file-system", 0, &flag_one_file_system, 1}, - {"path", 0, &flag_path, 1}, - {"preserve", 0, &flag_preserve, 1}, - {"recursive", 0, NULL, 'R'}, - {"suffix", 1, NULL, 'S'}, - {"symbolic-link", 0, NULL, 's'}, - {"update", 0, &flag_update, 1}, - {"verbose", 0, &flag_verbose, 1}, - {"version-control", 1, NULL, 'V'}, + {"archive", no_argument, NULL, 'a'}, + {"backup", no_argument, NULL, 'b'}, + {"force", no_argument, NULL, 'f'}, + {"interactive", no_argument, NULL, 'i'}, + {"link", no_argument, NULL, 'l'}, + {"no-dereference", no_argument, &flag_dereference, 0}, + {"one-file-system", no_argument, &flag_one_file_system, 1}, + {"path", no_argument, &flag_path, 1}, + {"preserve", no_argument, &flag_preserve, 1}, + {"recursive", no_argument, NULL, 'R'}, + {"suffix", required_argument, NULL, 'S'}, + {"symbolic-link", no_argument, NULL, 's'}, + {"update", no_argument, &flag_update, 1}, + {"verbose", no_argument, &flag_verbose, 1}, + {"version-control", required_argument, NULL, 'V'}, {NULL, 0, NULL, 0} }; @@ -96,11 +96,11 @@ static struct mount_entry *mount_list; static struct option const long_options[] = { - {"all", 0, &show_all_fs, 1}, - {"inodes", 0, &inode_format, 1}, - {"kilobytes", 0, &kilobyte_blocks, 1}, - {"portability", 0, &posix_format, 1}, - {"type", 1, 0, 't'}, + {"all", no_argument, &show_all_fs, 1}, + {"inodes", no_argument, &inode_format, 1}, + {"kilobytes", no_argument, &kilobyte_blocks, 1}, + {"portability", no_argument, &posix_format, 1}, + {"type", required_argument, 0, 't'}, {NULL, 0, NULL, 0} }; @@ -157,16 +157,16 @@ static int exit_status; static struct option const long_options[] = { - {"all", 0, &opt_all, 1}, - {"bytes", 0, NULL, 'b'}, - {"count-links", 0, &opt_count_all, 1}, - {"dereference", 0, NULL, 'L'}, - {"dereference-args", 0, &opt_dereference_arguments, 1}, - {"kilobytes", 0, NULL, 'k'}, - {"one-file-system", 0, &opt_one_file_system, 1}, - {"separate-dirs", 0, &opt_separate_dirs, 1}, - {"summarize", 0, &opt_summarize_only, 1}, - {"total", 0, &opt_combined_arguments, 1}, + {"all", no_argument, &opt_all, 1}, + {"bytes", no_argument, NULL, 'b'}, + {"count-links", no_argument, &opt_count_all, 1}, + {"dereference", no_argument, NULL, 'L'}, + {"dereference-args", no_argument, &opt_dereference_arguments, 1}, + {"kilobytes", no_argument, NULL, 'k'}, + {"one-file-system", no_argument, &opt_one_file_system, 1}, + {"separate-dirs", no_argument, &opt_separate_dirs, 1}, + {"summarize", no_argument, &opt_summarize_only, 1}, + {"total", no_argument, &opt_combined_arguments, 1}, {NULL, 0, NULL, 0} }; diff --git a/src/install.c b/src/install.c index 326fb57e2..c4d8c9de4 100644 --- a/src/install.c +++ b/src/install.c @@ -126,11 +126,11 @@ static int dir_arg; static struct option const long_options[] = { - {"strip", 0, NULL, 's'}, - {"directory", 0, NULL, 'd'}, - {"group", 1, NULL, 'g'}, - {"mode", 1, NULL, 'm'}, - {"owner", 1, NULL, 'o'}, + {"strip", no_argument, NULL, 's'}, + {"directory", no_argument, NULL, 'd'}, + {"group", required_argument, NULL, 'g'}, + {"mode", required_argument, NULL, 'm'}, + {"owner", required_argument, NULL, 'o'}, {NULL, 0, NULL, 0} }; @@ -65,14 +65,14 @@ char *program_name; static struct option const long_options[] = { - {"backup", 0, NULL, 'b'}, - {"directory", 0, &hard_dir_link, 1}, - {"force", 0, NULL, 'f'}, - {"interactive", 0, NULL, 'i'}, - {"suffix", 1, NULL, 'S'}, - {"symbolic", 0, &symbolic_link, 1}, - {"verbose", 0, &verbose, 1}, - {"version-control", 1, NULL, 'V'}, + {"backup", no_argument, NULL, 'b'}, + {"directory", no_argument, &hard_dir_link, 1}, + {"force", no_argument, NULL, 'f'}, + {"interactive", no_argument, NULL, 'i'}, + {"suffix", required_argument, NULL, 'S'}, + {"symbolic", no_argument, &symbolic_link, 1}, + {"verbose", no_argument, &verbose, 1}, + {"version-control", required_argument, NULL, 'V'}, {NULL, 0, NULL, 0} }; @@ -422,29 +422,29 @@ main (argc, argv) static struct option const long_options[] = { - {"all", 0, 0, 'a'}, - {"escape", 0, 0, 'b'}, - {"directory", 0, 0, 'd'}, - {"inode", 0, 0, 'i'}, - {"kilobytes", 0, 0, 'k'}, - {"numeric-uid-gid", 0, 0, 'n'}, - {"hide-control-chars", 0, 0, 'q'}, - {"reverse", 0, 0, 'r'}, - {"size", 0, 0, 's'}, - {"width", 1, 0, 'w'}, - {"almost-all", 0, 0, 'A'}, - {"ignore-backups", 0, 0, 'B'}, - {"classify", 0, 0, 'F'}, - {"file-type", 0, 0, 'F'}, - {"ignore", 1, 0, 'I'}, - {"dereference", 0, 0, 'L'}, - {"literal", 0, 0, 'N'}, - {"quote-name", 0, 0, 'Q'}, - {"recursive", 0, 0, 'R'}, - {"format", 1, 0, 12}, - {"sort", 1, 0, 10}, - {"tabsize", 1, 0, 'T'}, - {"time", 1, 0, 11}, + {"all", no_argument, 0, 'a'}, + {"escape", no_argument, 0, 'b'}, + {"directory", no_argument, 0, 'd'}, + {"inode", no_argument, 0, 'i'}, + {"kilobytes", no_argument, 0, 'k'}, + {"numeric-uid-gid", no_argument, 0, 'n'}, + {"hide-control-chars", no_argument, 0, 'q'}, + {"reverse", no_argument, 0, 'r'}, + {"size", no_argument, 0, 's'}, + {"width", required_argument, 0, 'w'}, + {"almost-all", no_argument, 0, 'A'}, + {"ignore-backups", no_argument, 0, 'B'}, + {"classify", no_argument, 0, 'F'}, + {"file-type", no_argument, 0, 'F'}, + {"ignore", required_argument, 0, 'I'}, + {"dereference", no_argument, 0, 'L'}, + {"literal", no_argument, 0, 'N'}, + {"quote-name", no_argument, 0, 'Q'}, + {"recursive", no_argument, 0, 'R'}, + {"format", required_argument, 0, 12}, + {"sort", required_argument, 0, 10}, + {"tabsize", required_argument, 0, 'T'}, + {"time", required_argument, 0, 11}, {0, 0, 0, 0} }; diff --git a/src/mkdir.c b/src/mkdir.c index d8de4aff2..00bde815f 100644 --- a/src/mkdir.c +++ b/src/mkdir.c @@ -46,8 +46,8 @@ char *program_name; static struct option const longopts[] = { - {"mode", 1, NULL, 'm'}, - {"path", 0, &path_mode, 1}, + {"mode", required_argument, NULL, 'm'}, + {"path", no_argument, &path_mode, 1}, {NULL, 0, NULL, 0} }; diff --git a/src/mkfifo.c b/src/mkfifo.c index b2bc15247..075cece51 100644 --- a/src/mkfifo.c +++ b/src/mkfifo.c @@ -37,7 +37,7 @@ char *program_name; static struct option const longopts[] = { - {"mode", 1, NULL, 'm'}, + {"mode", required_argument, NULL, 'm'}, {NULL, 0, NULL, 0} }; diff --git a/src/mknod.c b/src/mknod.c index d3091a5bf..66029ad0f 100644 --- a/src/mknod.c +++ b/src/mknod.c @@ -42,7 +42,7 @@ char *program_name; static struct option const longopts[] = { - {"mode", 1, NULL, 'm'}, + {"mode", required_argument, NULL, 'm'}, {NULL, 0, NULL, 0} }; @@ -88,13 +88,13 @@ static uid_t myeuid; static struct option const long_options[] = { - {"backup", 0, NULL, 'b'}, - {"force", 0, NULL, 'f'}, - {"interactive", 0, NULL, 'i'}, - {"suffix", 1, NULL, 'S'}, - {"update", 0, &update, 1}, - {"verbose", 0, &verbose, 1}, - {"version-control", 1, NULL, 'V'}, + {"backup", no_argument, NULL, 'b'}, + {"force", no_argument, NULL, 'f'}, + {"interactive", no_argument, NULL, 'i'}, + {"suffix", required_argument, NULL, 'S'}, + {"update", no_argument, &update, 1}, + {"verbose", no_argument, &verbose, 1}, + {"version-control", required_argument, NULL, 'V'}, {NULL, 0, NULL, 0} }; @@ -78,11 +78,11 @@ static int stdin_tty; static struct option const long_opts[] = { - {"directory", 0, &unlink_dirs, 1}, - {"force", 0, NULL, 'f'}, - {"interactive", 0, NULL, 'i'}, - {"recursive", 0, &recursive, 1}, - {"verbose", 0, &verbose, 1}, + {"directory", no_argument, &unlink_dirs, 1}, + {"force", no_argument, NULL, 'f'}, + {"interactive", no_argument, NULL, 'i'}, + {"recursive", no_argument, &recursive, 1}, + {"verbose", no_argument, &verbose, 1}, {NULL, 0, NULL, 0} }; diff --git a/src/rmdir.c b/src/rmdir.c index 137efb69c..35bd7d652 100644 --- a/src/rmdir.c +++ b/src/rmdir.c @@ -41,7 +41,7 @@ char *program_name; static struct option const longopts[] = { - {"path", 0, &empty_paths, 1}, + {"path", no_argument, &empty_paths, 1}, {NULL, 0, NULL, 0} }; diff --git a/src/touch.c b/src/touch.c index f3848ed80..65d76279f 100644 --- a/src/touch.c +++ b/src/touch.c @@ -95,10 +95,10 @@ char *program_name; static struct option const longopts[] = { - {"time", 1, 0, 130}, - {"no-create", 0, 0, 'c'}, - {"date", 1, 0, 'd'}, - {"file", 1, 0, 'r'}, + {"time", required_argument, 0, 130}, + {"no-create", no_argument, 0, 'c'}, + {"date", required_argument, 0, 'd'}, + {"file", required_argument, 0, 'r'}, {0, 0, 0, 0} }; |