[hackers] [ubase] chvt: usage using argv0 || Hiltjo Posthuma

From: <git_AT_suckless.org>
Date: Fri, 6 Feb 2015 16:16:29 +0100 (CET)

commit f0cfd58e932e01a7aad5d923aa4e558a02ff404e
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Mon Feb 2 19:56:17 2015 +0100

    chvt: usage using argv0

diff --git a/chvt.c b/chvt.c
index 5394588..95e4ff8 100644
--- a/chvt.c
+++ b/chvt.c
_AT_@ -25,7 +25,7 @@ static char *vts[] = {
 static void
 usage(void)
 {
- eprintf("usage: chvt N\n");
+ eprintf("usage: %s N\n", argv0);
 }
 
 int
_AT_@ -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();
 
Received on Fri Feb 06 2015 - 16:16:29 CET

This archive was generated by hypermail 2.3.0 : Fri Feb 06 2015 - 16:24:16 CET