Add back version flag to prepare for release

This commit is contained in:
drkhsh 2023-05-15 19:14:52 +02:00
parent 483169021b
commit 86c7a84c23
3 changed files with 6 additions and 2 deletions

View File

@ -11,7 +11,7 @@ X11INC = /usr/X11R6/include
X11LIB = /usr/X11R6/lib X11LIB = /usr/X11R6/lib
# flags # 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 CFLAGS = -std=c99 -pedantic -Wall -Wextra -Wno-unused-parameter -Os
LDFLAGS = -L$(X11LIB) -s LDFLAGS = -L$(X11LIB) -s
# OpenBSD: add -lsndio # OpenBSD: add -lsndio

View File

@ -22,6 +22,8 @@ By default,
outputs to WM_NAME. outputs to WM_NAME.
.Sh OPTIONS .Sh OPTIONS
.Bl -tag -width Ds .Bl -tag -width Ds
.It Fl v
Print version information to stderr, then exit.
.It Fl s .It Fl s
Write to stdout instead of WM_NAME. Write to stdout instead of WM_NAME.
.It Fl 1 .It Fl 1

View File

@ -41,7 +41,7 @@ difftimespec(struct timespec *res, struct timespec *a, struct timespec *b)
static void static void
usage(void) usage(void)
{ {
die("usage: %s [-s] [-1]", argv0); die("usage: %s [-v] [-s] [-1]", argv0);
} }
int int
@ -56,6 +56,8 @@ main(int argc, char *argv[])
sflag = 0; sflag = 0;
ARGBEGIN { ARGBEGIN {
case 'v':
die("slstatus-"VERSION);
case '1': case '1':
done = 1; done = 1;
/* FALLTHROUGH */ /* FALLTHROUGH */