chvt: usage using argv0

This commit is contained in:
Hiltjo Posthuma 2015-02-02 19:56:17 +01:00 committed by sin
parent a46944add9
commit f0cfd58e93
1 changed files with 4 additions and 1 deletions

5
chvt.c
View File

@ -25,7 +25,7 @@ static char *vts[] = {
static void static void
usage(void) usage(void)
{ {
eprintf("usage: chvt N\n"); eprintf("usage: %s N\n", argv0);
} }
int int
@ -35,6 +35,9 @@ main(int argc, char *argv[])
int fd; int fd;
char c; char c;
ARGBEGIN {
} ARGEND;
if (argc != 2 || strspn(argv[1], "1234567890") != strlen(argv[1])) if (argc != 2 || strspn(argv[1], "1234567890") != strlen(argv[1]))
usage(); usage();