From 14749b6c878f231a1120fc750d38f0c4383090a1 Mon Sep 17 00:00:00 2001
From: Aaron Marcher <info@nulltime.net>
Date: Sun, 18 Sep 2016 17:03:53 +0200
Subject: [PATCH] added -v command line option

---
 slstatus.1 | 3 +++
 slstatus.c | 5 ++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/slstatus.1 b/slstatus.1
index fd32981..adaf052 100644
--- a/slstatus.1
+++ b/slstatus.1
@@ -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
diff --git a/slstatus.c b/slstatus.c
index 174a17c..8479bf1 100644
--- a/slstatus.c
+++ b/slstatus.c
@@ -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