summaryrefslogtreecommitdiff
path: root/mcwm.c
diff options
context:
space:
mode:
Diffstat (limited to 'mcwm.c')
-rw-r--r--mcwm.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/mcwm.c b/mcwm.c
index 4cd773f..6a2e6ce 100644
--- a/mcwm.c
+++ b/mcwm.c
@@ -371,6 +371,7 @@ static void configwin(xcb_window_t win, uint16_t mask, struct winconf wc);
static void configurerequest(xcb_configure_request_event_t *e);
static void events(void);
static void printhelp(void);
+static void printversion(void);
static void sigcatch(int sig);
static xcb_atom_t getatom(char *atom_name);
@@ -4264,7 +4265,7 @@ void events(void)
void printhelp(void)
{
printf("mcwm: Usage: mcwm [-b] [-s snapmargin] [-t terminal-program] "
- "[-f colour] [-u colour] [-x colour] \n");
+ "[-f colour] [-u colour] [-x colour] -V\n");
printf(" -b means draw no borders\n");
printf(" -s snapmargin in pixels\n");
printf(" -t urxvt will start urxvt when MODKEY + Return is pressed\n");
@@ -4272,6 +4273,12 @@ void printhelp(void)
"to a named color.\n");
printf(" -u colour sets colour for unfocused window borders.\n");
printf(" -x color sets colour for fixed window borders.\n");
+ printf(" -V merely prints mcwm's version string and exits immediatly.\n");
+}
+
+void printversion(void)
+{
+ printf("mcwm version: %s\n", VERSION);
}
void sigcatch(int sig)
@@ -4351,7 +4358,7 @@ int main(int argc, char **argv)
while (1)
{
- ch = getopt(argc, argv, "b:s:it:f:u:x:");
+ ch = getopt(argc, argv, "b:s:it:f:u:x:V");
if (-1 == ch)
{
@@ -4391,6 +4398,11 @@ int main(int argc, char **argv)
fixedcol = optarg;
break;
+ case 'V':
+ printversion();
+ exit(0);
+ break;
+
default:
printhelp();
exit(0);