summaryrefslogtreecommitdiff
path: root/slstatus.c
diff options
context:
space:
mode:
authorLaslo Hunhold <dev@frign.de>2017-08-10 21:36:29 +0200
committerAaron Marcher <me@drkhsh.at>2017-08-10 22:32:28 +0200
commit958c34052a13b964f5fd1e748c18796d155af7db (patch)
treeb4c0a00fa2293f8ac2c532c567757b4c76187fc3 /slstatus.c
parent8dad4910bfc75aa1085a20de95ceee951588deae (diff)
Convert slstatus.1 to mandoc, simplify it and remove -h
We also change the semantics of -v to only return the version information. There is now no need for usage() to exit with anything other than 1.
Diffstat (limited to 'slstatus.c')
-rw-r--r--slstatus.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/slstatus.c b/slstatus.c
index 5564771..9a4831d 100644
--- a/slstatus.c
+++ b/slstatus.c
@@ -70,7 +70,7 @@ static const char *vol_perc(const char *card);
static const char *wifi_perc(const char *iface);
static const char *wifi_essid(const char *iface);
static void sighandler(const int signo);
-static void usage(const int eval);
+static void usage(void);
char *argv0;
static unsigned short int delay = 0;
@@ -838,10 +838,10 @@ sighandler(const int signo)
}
static void
-usage(const int eval)
+usage(void)
{
fprintf(stderr, "usage: %s [-d] [-o] [-n] [-v] [-h]\n", argv0);
- exit(eval);
+ exit(1);
}
int
@@ -865,16 +865,14 @@ main(int argc, char *argv[])
nflag = 1;
break;
case 'v':
- printf("slstatus (C) 2016-2017 slstatus engineers\n");
+ printf("slstatus-"VERSION"\n");
return 0;
- case 'h':
- usage(0);
default:
- usage(1);
+ usage();
} ARGEND
if ((dflag && oflag) || (dflag && nflag) || (oflag && nflag)) {
- usage(1);
+ usage();
}
if (dflag && daemon(1, 1) < 0) {
err(1, "daemon");