From 5d8084daa7812931b53d65312b2cebf9a8453e49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?= Date: Mon, 9 May 2022 14:52:03 -0500 Subject: add flag to print version and exit --- dwl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'dwl.c') diff --git a/dwl.c b/dwl.c index 74b11a8..48eb1a3 100644 --- a/dwl.c +++ b/dwl.c @@ -2516,9 +2516,11 @@ main(int argc, char *argv[]) char *startup_cmd = NULL; int c; - while ((c = getopt(argc, argv, "s:h")) != -1) { + while ((c = getopt(argc, argv, "s:hv")) != -1) { if (c == 's') startup_cmd = optarg; + else if (c == 'v') + die("dwl " VERSION); else goto usage; } -- cgit v1.2.3