chvt: usage using argv0
This commit is contained in:
parent
a46944add9
commit
f0cfd58e93
5
chvt.c
5
chvt.c
@ -25,7 +25,7 @@ static char *vts[] = {
|
||||
static void
|
||||
usage(void)
|
||||
{
|
||||
eprintf("usage: chvt N\n");
|
||||
eprintf("usage: %s N\n", argv0);
|
||||
}
|
||||
|
||||
int
|
||||
@ -35,6 +35,9 @@ main(int argc, char *argv[])
|
||||
int fd;
|
||||
char c;
|
||||
|
||||
ARGBEGIN {
|
||||
} ARGEND;
|
||||
|
||||
if (argc != 2 || strspn(argv[1], "1234567890") != strlen(argv[1]))
|
||||
usage();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user