diff options
| author | Kyle Evans <kevans@FreeBSD.org> | 2018-04-30 18:55:01 +0000 |
|---|---|---|
| committer | Kyle Evans <kevans@FreeBSD.org> | 2018-04-30 18:55:01 +0000 |
| commit | a3f2c2feb132de5f141fbcae860ce6ab37a7a86d (patch) | |
| tree | 93cc3341a2cba468254de949d3b2203da5b0ba25 /usr.bin/seq/seq.c | |
| parent | f8bc08fa57ae4bc63b98f2de286f9faf354bc2f5 (diff) | |
Notes
Diffstat (limited to 'usr.bin/seq/seq.c')
| -rw-r--r-- | usr.bin/seq/seq.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.bin/seq/seq.c b/usr.bin/seq/seq.c index 3ffcb6108dd0..411cae218266 100644 --- a/usr.bin/seq/seq.c +++ b/usr.bin/seq/seq.c @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include <ctype.h> #include <err.h> #include <errno.h> +#include <getopt.h> #include <math.h> #include <locale.h> #include <stdio.h> @@ -67,6 +68,15 @@ static int valid_format(const char *); static char *generate_format(double, double, double, int, char); static char *unescape(char *); +static const struct option long_opts[] = +{ + {"format", required_argument, NULL, 'f'}, + {"separator", required_argument, NULL, 's'}, + {"terminator", required_argument, NULL, 't'}, + {"equal-width", no_argument, NULL, 'w'}, + {NULL, no_argument, NULL, 0} +}; + /* * The seq command will print out a numeric sequence from 1, the default, * to a user specified upper limit by 1. The lower bound and increment @@ -100,7 +110,7 @@ main(int argc, char *argv[]) * least they trip up getopt(3). */ while ((optind < argc) && !numeric(argv[optind]) && - (c = getopt(argc, argv, "f:hs:t:w")) != -1) { + (c = getopt_long(argc, argv, "+f:hs:t:w", long_opts, NULL)) != -1) { switch (c) { case 'f': /* format (plan9) */ |
