added -t <default tag> to wmiiwm

This commit is contained in:
Anselm R. Garbe 2006-03-22 20:03:41 +01:00
parent 8874f818a1
commit 0d333433ab

View File

@ -24,7 +24,7 @@ static char version[] = "wmiiwm - " VERSION ", (C)opyright MMIV-MMVI Anselm R. G
static void
usage()
{
fprintf(stderr, "%s", "usage: wmiiwm -a <address> [-c] [-v]\n");
fprintf(stderr, "%s", "usage: wmiiwm -a <address> [-t <default tag>] [-c] [-v]\n");
exit(1);
}
@ -222,6 +222,7 @@ main(int argc, char *argv[])
XSetWindowAttributes wa;
/* command line args */
def.tag[0] = 0;
if(argc > 1) {
for(i = 1; (i < argc) && (argv[i][0] == '-'); i++) {
switch (argv[i][1]) {
@ -232,6 +233,9 @@ main(int argc, char *argv[])
case 'c':
checkwm = 1;
break;
case 't':
cext_strlcpy(def.tag, argv[++i], sizeof(def.tag));
break;
case 'a':
if(i + 1 < argc)
address = argv[++i];
@ -309,7 +313,8 @@ main(int argc, char *argv[])
def.font = strdup(BLITZ_FONT);
def.border = DEF_BORDER;
def.snap = DEF_SNAP;
cext_strlcpy(def.tag, "1", sizeof(def.tag));
if(!strlen(def.tag))
cext_strlcpy(def.tag, "1", sizeof(def.tag));
cext_strlcpy(def.selcolor, BLITZ_SELCOLORS, sizeof(def.selcolor));
blitz_loadcolor(dpy, screen, def.selcolor, &def.sel);
cext_strlcpy(def.normcolor, BLITZ_NORMCOLORS, sizeof(def.normcolor));