diff options
author | jmallett <jmallett@FreeBSD.org> | 2002-06-14 09:54:48 +0000 |
---|---|---|
committer | jmallett <jmallett@FreeBSD.org> | 2002-06-14 09:54:48 +0000 |
commit | f46221a82d7324873705a0a3f5f327133a019a6a (patch) | |
tree | ca23c63c742caa3650b878d6ac43bd55d592894d /bin/cat/cat.c | |
parent | 5a8b5dcfa466e28d13a45b0c3d01ac60e2e64e25 (diff) | |
download | FreeBSD-src-f46221a82d7324873705a0a3f5f327133a019a6a.zip FreeBSD-src-f46221a82d7324873705a0a3f5f327133a019a6a.tar.gz |
Use an usage() rather than doing the fprintf inside option parsing.
Diffstat (limited to 'bin/cat/cat.c')
-rw-r--r-- | bin/cat/cat.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/bin/cat/cat.c b/bin/cat/cat.c index 2648a7d..3ea05de 100644 --- a/bin/cat/cat.c +++ b/bin/cat/cat.c @@ -70,6 +70,7 @@ int bflag, eflag, nflag, sflag, tflag, vflag; int rval; const char *filename; +static void usage(void); static void scanfiles(char **argv, int cooked); static void cook_cat(FILE *); static void raw_cat(int); @@ -109,9 +110,7 @@ main(int argc, char *argv[]) vflag = 1; break; default: - fprintf(stderr, - "usage: cat [-benstuv] [file ...]\n"); - exit(1); + usage(); } argv += optind; @@ -124,6 +123,13 @@ main(int argc, char *argv[]) exit(rval); } +static void +usage(void) +{ + fprintf(stderr, "usage: cat [-benstuv] [file ...]\n"); + exit(1); +} + void scanfiles(char **argv, int cooked) { |