Add usage().
This commit is contained in:
parent
1aa67f6900
commit
d98fe20585
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=27100
14
usr.bin/env/env.c
vendored
14
usr.bin/env/env.c
vendored
@ -49,6 +49,8 @@ static char sccsid[] = "@(#)env.c 8.3 (Berkeley) 4/2/94";
|
||||
|
||||
extern char **environ;
|
||||
|
||||
static void usage __P((void));
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
@ -66,9 +68,7 @@ main(argc, argv)
|
||||
break;
|
||||
case '?':
|
||||
default:
|
||||
(void)fprintf(stderr,
|
||||
"usage: env [-] [name=value ...] [command]\n");
|
||||
exit(1);
|
||||
usage();
|
||||
}
|
||||
for (argv += optind; *argv && (p = strchr(*argv, '=')); ++argv)
|
||||
(void)setenv(*argv, ++p, 1);
|
||||
@ -80,3 +80,11 @@ main(argc, argv)
|
||||
(void)printf("%s\n", *ep);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
static void
|
||||
usage()
|
||||
{
|
||||
(void)fprintf(stderr,
|
||||
"usage: env [-] [name=value ...] [command]\n");
|
||||
exit(1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user