From: Jim Meyering Date: Fri, 26 Mar 1999 04:23:55 +0000 (+0000) Subject: No longer include long-options.h. X-Git-Tag: FILEUTILS-4_0e~93 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c060f16ed7d5151b35f81c2f70006d2052ae1ea3;p=thirdparty%2Fcoreutils.git 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. --- diff --git a/src/ls.c b/src/ls.c index e985a4b4c3..26e871b50b 100644 --- a/src/ls.c +++ b/src/ls.c @@ -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); }