summaryrefslogtreecommitdiff
path: root/src/fmt.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/fmt.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/fmt.c')
-rw-r--r--src/fmt.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/fmt.c b/src/fmt.c
index 2aabbe96e..7aa973885 100644
--- a/src/fmt.c
+++ b/src/fmt.c
@@ -28,6 +28,7 @@
#include "system.h"
#include "error.h"
+#include "long-options.h"
#include "xstrtol.h"
/* The following parameters represent the program's idea of what is
@@ -164,12 +165,6 @@ static void put_space PARAMS ((int space));
/* The name this program was run with. */
const char *program_name;
-/* If nonzero, display usage information and exit. */
-static int show_help = 0;
-
-/* If nonzero, print the version on standard output and exit. */
-static int show_version = 0;
-
/* Option values. */
/* If TRUE, first 2 lines may have different indent (default FALSE). */
@@ -297,12 +292,10 @@ In -wNUMBER, the letter `w' may be omitted.\n"),
static const struct option long_options[] =
{
{"crown-margin", no_argument, NULL, 'c'},
- {"help", no_argument, &show_help, 1},
{"prefix", required_argument, NULL, 'p'},
{"split-only", no_argument, NULL, 's'},
{"tagged-paragraph", no_argument, NULL, 't'},
{"uniform-spacing", no_argument, NULL, 'u'},
- {"version", no_argument, &show_version, 1},
{"width", required_argument, NULL, 'w'},
{0, 0, 0, 0},
};
@@ -317,6 +310,9 @@ main (register int argc, register char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
+ parse_long_options (argc, argv, "fmt", GNU_PACKAGE, VERSION,
+ "Ross Paterson", usage);
+
crown = tagged = split = uniform = FALSE;
max_width = WIDTH;
prefix = "";
@@ -382,15 +378,6 @@ main (register int argc, register char **argv)
}
- if (show_version)
- {
- printf ("fmt (%s) %s\n", GNU_PACKAGE, VERSION);
- exit (EXIT_SUCCESS);
- }
-
- if (show_help)
- usage (0);
-
best_width = max_width * (2 * (100 - LEEWAY) + 1) / 200;
if (optind == argc)