summaryrefslogtreecommitdiff
path: root/mcwm.c
diff options
context:
space:
mode:
authorMC <mc@hack.org>2010-06-22 09:43:24 +0200
committerMC <mc@hack.org>2010-06-22 09:43:24 +0200
commitb8fb5591aa9398cc403130d3892e8bf9ee3f22b9 (patch)
tree3f31a93bb1e4d29a97896c2a3782bb30a4373d48 /mcwm.c
parent9cfdee5578fac292f62a115a64d392039ae1c3bb (diff)
downloadmcwm-b8fb5591aa9398cc403130d3892e8bf9ee3f22b9.zip
Added terminal option.
Added help text. Removed unused "m" option.
Diffstat (limited to 'mcwm.c')
-rw-r--r--mcwm.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/mcwm.c b/mcwm.c
index 36384d6..aa9d05d 100644
--- a/mcwm.c
+++ b/mcwm.c
@@ -125,6 +125,7 @@ void movestep(xcb_drawable_t win, char direction);
void maximize(xcb_drawable_t win);
void maxvert(xcb_drawable_t win);
void handle_keypress(xcb_drawable_t win, xcb_key_press_event_t *ev);
+void printhelp(void);
/* Function bodies. */
@@ -1408,6 +1409,14 @@ void events(void)
}
}
+void printhelp(void)
+{
+ printf("mcwm: Usage: mcwm [-b] [-t /path/to/terminal]\n");
+ printf(" -b means draw no borders\n");
+ printf(" -t /usr/local/bin/urxvt will start urxvt when MODKEY + Return "
+ "is pressed\n");
+}
+
int main(int argc, char **argv)
{
uint32_t mask = 0;
@@ -1421,7 +1430,7 @@ int main(int argc, char **argv)
while (1)
{
- ch = getopt(argc, argv, "bm");
+ ch = getopt(argc, argv, "bt:");
if (-1 == ch)
{
@@ -1435,7 +1444,15 @@ int main(int argc, char **argv)
/* No borders. */
conf.borders = false;
break;
- }
+
+ case 't':
+ terminal = optarg;
+ break;
+
+ default:
+ printhelp();
+ exit(0);
+ } /* switch */
}
conn = xcb_connect(NULL, NULL);