added -v command line option
authorAaron Marcher <info@nulltime.net>
Sun, 18 Sep 2016 15:03:53 +0000 (17:03 +0200)
committerAaron Marcher (drkhsh) <info@nulltime.net>
Sun, 18 Sep 2016 15:03:53 +0000 (17:03 +0200)
slstatus.1
slstatus.c

index fd32981aff6b8a2dc9cfcd5851a8f2f1c1d74672..adaf0522c7e59d1bc3cc36f4cbff1295e3e74bdd 100644 (file)
@@ -16,6 +16,9 @@ displays usage
 .TP
 .B \-o
 output to console instead of WM_NAME
+.TP
+.B \-v
+display version and copyright details
 .SH CUSTOMIZATION
 .B slstatus
 can be customized by creating a custom config.h and (re)compiling the source
index 174a17cfdf2474734628ae9a0532c50c5e5f50f0..8479bf157b36bdd17131d4cefea36c6dcf7a6cd9 100644 (file)
@@ -592,7 +592,7 @@ sighandler(const int signo)
 static void
 usage(void)
 {
-       fprintf(stderr, "usage: %s [-dho]\n", argv0);
+       fprintf(stderr, "usage: %s [-dhov]\n", argv0);
        exit(1);
 }
 
@@ -612,6 +612,9 @@ main(int argc, char *argv[])
                case 'o':
                        oflag = 1;
                        break;
+               case 'v':
+                       printf("%s version %s (c) 2016 slstatus engineers\n", argv0, VERSION);
+                       return 0;
                default:
                        usage();
        } ARGEND