diff options
author | Jim Meyering <jim@meyering.net> | 1999-03-26 14:22:51 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1999-03-26 14:22:51 +0000 |
commit | f42367c3e7f266dce685aed7a6629d13ba5a324c (patch) | |
tree | d3afe8acc5effc50e33eee1d571e763180f219cf /src/ln.c | |
parent | 0aa9923d96b671490bc0a44e99c1e9cae526681e (diff) | |
download | coreutils-f42367c3e7f266dce685aed7a6629d13ba5a324c.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.
Diffstat (limited to 'src/ln.c')
-rw-r--r-- | src/ln.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -31,7 +31,12 @@ #include "closeout.h" #include "dirname.h" #include "error.h" -#include "long-options.h" +#include "version-etc.h" + +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "ln" + +#define AUTHORS "Mike Parker and David MacKenzie" int link (); /* Some systems don't declare this anywhere. */ @@ -109,6 +114,8 @@ static struct option const long_options[] = {"symbolic", no_argument, NULL, 's'}, {"verbose", no_argument, NULL, 'v'}, {"version-control", required_argument, NULL, 'V'}, + {GETOPT_HELP_OPTION_DECL}, + {GETOPT_VERSION_OPTION_DECL}, {NULL, 0, NULL, 0} }; @@ -379,9 +386,6 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - parse_long_options (argc, argv, "ln", GNU_PACKAGE, VERSION, - "Mike Parker and David MacKenzie", usage); - /* FIXME: consider not calling getenv for SIMPLE_BACKUP_SUFFIX unless we'll actually use simple_backup_suffix. */ version = getenv ("SIMPLE_BACKUP_SUFFIX"); @@ -434,6 +438,8 @@ main (int argc, char **argv) case 'V': version = optarg; break; + case_GETOPT_HELP_CHAR; + case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); default: usage (1); break; |