diff options
author | Jim Meyering <jim@meyering.net> | 1999-03-04 05:09:05 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1999-03-04 05:09:05 +0000 |
commit | 61fa70ac19d9202f6509e97e4bda1f4ab8f5d1fd (patch) | |
tree | 1fb89b9b511548ea40a899b6c60f1371cf6123f4 /src/ln.c | |
parent | d0bdbe00ba72224915a61589a399bc0e86d74d80 (diff) | |
download | coreutils-61fa70ac19d9202f6509e97e4bda1f4ab8f5d1fd.tar.xz |
Include long-options.h
[long_options]: Remove the "help" and "version" entries.
(main): Use parse_long_options, including author name(s).
Remove the show_version and show_help blocks.
Diffstat (limited to 'src/ln.c')
-rw-r--r-- | src/ln.c | 24 |
1 files changed, 5 insertions, 19 deletions
@@ -29,8 +29,9 @@ #include "system.h" #include "backupfile.h" #include "closeout.h" -#include "error.h" #include "dirname.h" +#include "error.h" +#include "long-options.h" int link (); /* Some systems don't declare this anywhere. */ @@ -97,12 +98,6 @@ static int hard_dir_link; symlink-to-dir before creating the new link. */ static int dereference_dest_dir_symlinks = 1; -/* If nonzero, display usage information and exit. */ -static int show_help; - -/* If nonzero, print the version on standard output and exit. */ -static int show_version; - static struct option const long_options[] = { {"backup", no_argument, NULL, 'b'}, @@ -114,8 +109,6 @@ static struct option const long_options[] = {"symbolic", no_argument, NULL, 's'}, {"verbose", no_argument, NULL, 'v'}, {"version-control", required_argument, NULL, 'V'}, - {"help", no_argument, &show_help, 1}, - {"version", no_argument, &show_version, 1}, {NULL, 0, NULL, 0} }; @@ -386,6 +379,9 @@ 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"); @@ -444,16 +440,6 @@ main (int argc, char **argv) } } - if (show_version) - { - printf ("ln (%s) %s\n", GNU_PACKAGE, VERSION); - close_stdout (); - exit (0); - } - - if (show_help) - usage (0); - if (optind == argc) { error (0, 0, _("missing file argument")); |