ubase

suckless linux base utils
git clone git://git.2f30.org/ubase
Log | Files | Refs | README | LICENSE

commit f0cfd58e932e01a7aad5d923aa4e558a02ff404e
parent a46944add9146303500834b2c5d336694bd04a72
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Mon,  2 Feb 2015 19:56:17 +0100

chvt: usage using argv0

Diffstat:
Mchvt.c | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/chvt.c b/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();