summaryrefslogtreecommitdiff
path: root/src/expand.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-03-04 05:36:10 +0000
committerJim Meyering <jim@meyering.net>1999-03-04 05:36:10 +0000
commit88cbad981787d34f3dc8118bde16416c12a50421 (patch)
tree1a8993c9e22726767a534efd76dd619bfc80752d /src/expand.c
parent0ae96f236175101ddc6c8f0eaf46d08f88173486 (diff)
downloadcoreutils-88cbad981787d34f3dc8118bde16416c12a50421.tar.xz
Include long-options.h
[long_options]: Remove the "help" and "version" entries. Remove declarations of show_help and show_version. (main): Use parse_long_options, including author name(s). Remove the show_version and show_help blocks.
Diffstat (limited to 'src/expand.c')
-rw-r--r--src/expand.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/expand.c b/src/expand.c
index 20d74a91e..b0fe973fc 100644
--- a/src/expand.c
+++ b/src/expand.c
@@ -40,6 +40,7 @@
#include <sys/types.h>
#include "system.h"
#include "error.h"
+#include "long-options.h"
/* The number of bytes added at a time to the amount of memory
allocated for the output line. */
@@ -83,18 +84,10 @@ static int have_read_stdin;
/* Status to return to the system. */
static int exit_status;
-/* If nonzero, display usage information and exit. */
-static int show_help;
-
-/* If nonzero, print the version on standard output then exit. */
-static int show_version;
-
static struct option const longopts[] =
{
{"tabs", required_argument, NULL, 't'},
{"initial", no_argument, NULL, 'i'},
- {"help", no_argument, &show_help, 1},
- {"version", no_argument, &show_version, 1},
{NULL, 0, NULL, 0}
};
@@ -340,6 +333,9 @@ main (int argc, char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
+ parse_long_options (argc, argv, "expand", GNU_PACKAGE, VERSION,
+ "David MacKenzie", usage);
+
while ((c = getopt_long (argc, argv, "it:,0123456789", longopts, NULL)) != -1)
{
switch (c)
@@ -367,15 +363,6 @@ main (int argc, char **argv)
}
}
- if (show_version)
- {
- printf ("expand (%s) %s\n", GNU_PACKAGE, VERSION);
- exit (EXIT_SUCCESS);
- }
-
- if (show_help)
- usage (0);
-
add_tabstop (tabval);
validate_tabstops (tab_list, first_free_tab);