]> Skullheadx's Git Forge - slstatus.git/commitdiff
Add back version flag to prepare for release
authordrkhsh <me@drkhsh.at>
Mon, 15 May 2023 17:14:52 +0000 (19:14 +0200)
committerdrkhsh <me@drkhsh.at>
Mon, 15 May 2023 17:16:12 +0000 (19:16 +0200)
config.mk
slstatus.1
slstatus.c

index ead1859fb7ef9494a83779421e66c429b8c4d670..2ba2911e595d83ebed4cca23e5d6aff4ceeae678 100644 (file)
--- a/config.mk
+++ b/config.mk
@@ -11,7 +11,7 @@ X11INC = /usr/X11R6/include
 X11LIB = /usr/X11R6/lib
 
 # flags
-CPPFLAGS = -I$(X11INC) -D_DEFAULT_SOURCE
+CPPFLAGS = -I$(X11INC) -D_DEFAULT_SOURCE -DVERSION=\"${VERSION}\"
 CFLAGS   = -std=c99 -pedantic -Wall -Wextra -Wno-unused-parameter -Os
 LDFLAGS  = -L$(X11LIB) -s
 # OpenBSD: add -lsndio
index bea2a8ca3524c216d671d5d7b2026d4021b7626d..73e7a60261eb79cf6b9b1b77648772ceba40f0d8 100644 (file)
@@ -22,6 +22,8 @@ By default,
 outputs to WM_NAME.
 .Sh OPTIONS
 .Bl -tag -width Ds
+.It Fl v
+Print version information to stderr, then exit.
 .It Fl s
 Write to stdout instead of WM_NAME.
 .It Fl 1
index cb54f2982ac09ff544e20c84961e12de63babfbb..fd313136a409524a47ee882498e5d1156b28ad00 100644 (file)
@@ -41,7 +41,7 @@ difftimespec(struct timespec *res, struct timespec *a, struct timespec *b)
 static void
 usage(void)
 {
-       die("usage: %s [-s] [-1]", argv0);
+       die("usage: %s [-v] [-s] [-1]", argv0);
 }
 
 int
@@ -56,6 +56,8 @@ main(int argc, char *argv[])
 
        sflag = 0;
        ARGBEGIN {
+       case 'v':
+               die("slstatus-"VERSION);
        case '1':
                done = 1;
                /* FALLTHROUGH */