mirror of
https://github.com/opnsense/src.git
synced 2026-04-15 14:29:58 -04:00
Use an usage() rather than doing the fprintf inside option parsing.
This commit is contained in:
parent
e73c3d279c
commit
ca2be2ff45
1 changed files with 9 additions and 3 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue