diff options
author | Jim Meyering <jim@meyering.net> | 1999-03-26 14:18:29 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1999-03-26 14:18:29 +0000 |
commit | 85b4cd220bdad64e22b4f06b09f7eae0f6e9ce6c (patch) | |
tree | 5ab499c9d451f7f6036e9bbde5991588a92d22ce | |
parent | f0a21a933a890ef15168f297b1953dfa5e1de031 (diff) | |
download | coreutils-85b4cd220bdad64e22b4f06b09f7eae0f6e9ce6c.tar.xz |
No longer include long-options.h.
Include version-etc.h instead.
(PROGRAM_NAME, AUTHORS): 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.
-rw-r--r-- | src/cp.c | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -35,8 +35,13 @@ #include "cp-hash.h" #include "error.h" #include "dirname.h" -#include "long-options.h" #include "path-concat.h" +#include "version-etc.h" + +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "cp" + +#define AUTHORS "Torbjorn Granlund, David MacKenzie, and Jim Meyering" #ifndef _POSIX_VERSION uid_t geteuid (); @@ -103,6 +108,8 @@ static struct option const long_opts[] = {"update", no_argument, NULL, 'u'}, {"verbose", no_argument, NULL, 'v'}, {"version-control", required_argument, NULL, 'V'}, + {GETOPT_HELP_OPTION_DECL}, + {GETOPT_VERSION_OPTION_DECL}, {NULL, 0, NULL, 0} }; @@ -631,10 +638,6 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - parse_long_options (argc, argv, "cp", GNU_PACKAGE, VERSION, - "Torbjorn Granlund, David MacKenzie, and Jim Meyering", - usage); - cp_option_init (&x); /* FIXME: consider not calling getenv for SIMPLE_BACKUP_SUFFIX unless @@ -738,6 +741,10 @@ main (int argc, char **argv) version = optarg; break; + case_GETOPT_HELP_CHAR; + + case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); + default: usage (1); } |