[hackers] [slock][PATCH] Allow usage of -- as end-of-options specifier

From: Klemens Nanni <kl3_AT_posteo.org>
Date: Fri, 28 Oct 2016 22:13:09 +0200

As pointed out in #suckless, sticking to the POSIX Utility Syntax
Guidelines[0] is a good idea.

0: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html#tag_12_02
---
 slock.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/slock.c b/slock.c
index af5edb2..1d28e3a 100644
--- a/slock.c
+++ b/slock.c
_AT_@ -302,6 +302,9 @@ main(int argc, char *argv[]) {
 		if (!strcmp("-v", argv[1])) {
 			fputs("slock-"VERSION"\n", stderr);
 			return 0;
+		} else if (!strcmp("--", argv[1])) {
+			--argc;
+			++argv;
 		} else
 			die("usage: slock [-v] [cmd [arg ...]]\n");
 	}
-- 
2.8.3
Received on Fri Oct 28 2016 - 22:13:09 CEST

This archive was generated by hypermail 2.3.0 : Fri Oct 28 2016 - 22:24:15 CEST