summaryrefslogtreecommitdiff
path: root/scope.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2012-10-19 22:29:41 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2012-10-22 20:05:59 -0700
commita248f83ea89f5d4df35fcdc1e07ef147f72c9cf6 (patch)
treef00ee67583d38af1e3974fb93215c62a73c2f843 /scope.c
parent13c3f1338ef1ed233cd3e400a6b6bd5f499be592 (diff)
downloadxscope-a248f83ea89f5d4df35fcdc1e07ef147f72c9cf6.tar.gz
Add -V option to print version and exit
Can't use -v, as that's already in use for verbosity level Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'scope.c')
-rw-r--r--scope.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/scope.c b/scope.c
index d3aa86f..1919569 100644
--- a/scope.c
+++ b/scope.c
@@ -670,6 +670,7 @@ Usage(void)
" [-D<debug-level>]\n"
" [-I] -- start in interactive mode\n"
" [-S<n>] -- start/stop on SIGUSR1\n"
+ " [-V] -- output version information and exit\n"
" [-t] -- terminate when all clients close\n");
exit(1);
}
@@ -727,6 +728,10 @@ ScanArgs(int argc, char **argv)
ScopeEnabled = atoi(++*argv);
break;
+ case 'V': /* print version & exit */
+ printf("%s\n", PACKAGE_STRING);
+ exit(0);
+
case 'q': /* quiet mode */
XVerbose = 0;
debug(1, (stderr, "Verbose = %d\n", XVerbose));