summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-10-16 00:08:00 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-10-16 00:09:16 +1000
commitb239eba5a9def3a684cd83fec384831f7359af69 (patch)
tree399876678371f5827206506a690510a7f88a793b
parent529f5ce2e4445134999f2b43a82580639441b70d (diff)
Fix swaylock version string
The referenced constants were not defined so it always printed "version unknown". Also it would exit with code 1. It now exits with code 0.
-rw-r--r--main.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/main.c b/main.c
index 04c0bb0..86dfd57 100644
--- a/main.c
+++ b/main.c
@@ -634,13 +634,9 @@ static int parse_options(int argc, char **argv, struct swaylock_state *state,
}
break;
case 'v':
-#if defined SWAY_GIT_VERSION && defined SWAY_GIT_BRANCH && defined SWAY_VERSION_DATE
- fprintf(stdout, "swaylock version %s (%s, branch \"%s\")\n",
- SWAY_GIT_VERSION, SWAY_VERSION_DATE, SWAY_GIT_BRANCH);
-#else
- fprintf(stdout, "version unknown\n");
-#endif
- return 1;
+ fprintf(stdout, "swaylock version " SWAY_VERSION "\n");
+ exit(EXIT_SUCCESS);
+ break;
case LO_BS_HL_COLOR:
if (state) {
state->args.colors.bs_highlight = parse_color(optarg);