X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;ds=sidebyside;f=dinput.c;h=64ce036eff7f6b7f14bf6a3b5115db55726ea107;hb=309d071df557142e6efc328bd1475760b4f576e6;hp=0bf267946ce520bd7268fdb8f04619103ff76ee0;hpb=18dcf738967a45208e880b72ce273afdd93ee6c7;p=dmenu.git diff --git a/dinput.c b/dinput.c index 0bf2679..64ce036 100644 --- a/dinput.c +++ b/dinput.c @@ -12,6 +12,7 @@ #ifdef XINERAMA #include #endif +#include /* macros */ #define CLEANMASK(mask) (mask & ~(numlockmask | LockMask)) @@ -30,7 +31,6 @@ static void run(void); static void setup(Bool topbar); #include "config.h" -#include "draw.h" /* variables */ static char *prompt = NULL; @@ -329,11 +329,15 @@ main(int argc, char *argv[]) { /* command line args */ progname = argv[0]; for(i = 1; i < argc; i++) - if(!strcmp(argv[i], "-b")) + if(!strcmp(argv[i], "-i")) + ; /* ignore flag */ + else if(!strcmp(argv[i], "-b")) topbar = False; else if(!strcmp(argv[i], "-e")) { if(++i < argc) parent = atoi(argv[i]); } + else if(!strcmp(argv[i], "-l")) + i++; /* ignore flag */ else if(!strcmp(argv[i], "-fn")) { if(++i < argc) font = argv[i]; } @@ -352,13 +356,17 @@ main(int argc, char *argv[]) { else if(!strcmp(argv[i], "-sf")) { if(++i < argc) selfgcolor = argv[i]; } - else if(!strcmp(argv[i], "-v")) - eprint("dinput-"VERSION", © 2006-2010 dinput engineers, see LICENSE for details\n"); + else if(!strcmp(argv[i], "-v")) { + printf("dinput-"VERSION", © 2006-2010 dinput engineers, see LICENSE for details\n"); + exit(EXIT_SUCCESS); + } else if(!*text) strncpy(text, argv[i], sizeof text); - else - eprint("usage: dinput [-b] [-e ] [-fn ] [-nb ] [-nf ]\n" - " [-p ] [-sb ] [-sf ] [-v] []\n"); + else { + fputs("usage: dinput [-b] [-e ] [-fn ] [-nb ] [-nf ]\n" + " [-p ] [-sb ] [-sf ] [-v] []\n", stderr); + exit(EXIT_FAILURE); + } if(!setlocale(LC_CTYPE, "") || !XSupportsLocale()) fprintf(stderr, "dinput: warning: no locale support\n"); if(!(dpy = XOpenDisplay(NULL)))