diff options
author | Jim Meyering <jim@meyering.net> | 1999-03-26 04:23:55 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1999-03-26 04:23:55 +0000 |
commit | c060f16ed7d5151b35f81c2f70006d2052ae1ea3 (patch) | |
tree | 02adc9adbf40d696c3fa9f7a22cbe2958f25456a /src/ls.c | |
parent | f19d194943c1af6e398dd964d31fa39985d6da22 (diff) | |
download | coreutils-c060f16ed7d5151b35f81c2f70006d2052ae1ea3.tar.xz |
No longer include long-options.h.
Include version-etc.h instead.
(PROGRAM_NAME): Define.
[long_options]: Add entries for --help and --version.
Remove parse_long_options call.
(main) [getopt switch]: Add a case for each of --help and --version.
Diffstat (limited to 'src/ls.c')
-rw-r--r-- | src/ls.c | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -73,14 +73,18 @@ #include "error.h" #include "human.h" #include "filemode.h" -#include "long-options.h" #include "ls.h" #include "obstack.h" #include "path-concat.h" #include "quotearg.h" #include "strverscmp.h" +#include "version-etc.h" #include "xstrtol.h" +#define PROGRAM_NAME (ls_mode == LS_LS ? "ls" \ + : (ls_mode == LS_MULTI_COL \ + ? "dir" : "vdir")) + #define obstack_chunk_alloc malloc #define obstack_chunk_free free @@ -569,6 +573,8 @@ static struct option const long_options[] = {"time", required_argument, 0, 11}, {"color", optional_argument, 0, 13}, {"block-size", required_argument, 0, 17}, + {GETOPT_HELP_OPTION_DECL}, + {GETOPT_VERSION_OPTION_DECL}, {NULL, 0, NULL, 0} }; @@ -718,13 +724,6 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); -#define PROGRAM_NAME (ls_mode == LS_LS ? "ls" \ - : (ls_mode == LS_MULTI_COL \ - ? "dir" : "vdir")) - - parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - "Richard Stallman and David MacKenzie", usage); - exit_status = 0; dir_defaulted = 1; print_dir_name = 1; @@ -1175,6 +1174,11 @@ decode_switches (int argc, char **argv) human_block_size (optarg, 1, &output_block_size); break; + case_GETOPT_HELP_CHAR; + + case_GETOPT_VERSION_CHAR (PROGRAM_NAME, + "Richard Stallman and David MacKenzie"); + default: usage (EXIT_FAILURE); } |