mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
Fix -c option, and make -k accept -c option better
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
be12562ab7
commit
507ef3c21d
1 changed files with 7 additions and 4 deletions
11
awesome.c
11
awesome.c
|
@ -177,7 +177,7 @@ main(int argc, char *argv[])
|
|||
struct sockaddr_un *addr;
|
||||
Client *c;
|
||||
XSetWindowAttributes wa;
|
||||
Bool xsync = False;
|
||||
Bool xsync = False, confcheck = False;
|
||||
static struct option long_options[] =
|
||||
{
|
||||
{"help", 0, NULL, 'h'},
|
||||
|
@ -202,7 +202,7 @@ main(int argc, char *argv[])
|
|||
}
|
||||
|
||||
/* check args */
|
||||
while((opt = getopt_long(argc, argv, "vhkcs:",
|
||||
while((opt = getopt_long(argc, argv, "vhkc:s",
|
||||
long_options, NULL)) != -1)
|
||||
switch(opt)
|
||||
{
|
||||
|
@ -214,12 +214,12 @@ main(int argc, char *argv[])
|
|||
break;
|
||||
case 'c':
|
||||
if(a_strlen(optarg))
|
||||
confpath = optarg;
|
||||
confpath = a_strdup(optarg);
|
||||
else
|
||||
eprint("-c option requires a file name\n");
|
||||
break;
|
||||
case 'k':
|
||||
return config_check(confpath);
|
||||
confcheck = True;
|
||||
break;
|
||||
case 's':
|
||||
xsync = True;
|
||||
|
@ -229,6 +229,9 @@ main(int argc, char *argv[])
|
|||
/* Text won't be printed correctly otherwise */
|
||||
setlocale(LC_CTYPE, "");
|
||||
|
||||
if(confcheck)
|
||||
return config_check(confpath);
|
||||
|
||||
/* X stuff */
|
||||
if(!(dpy = XOpenDisplay(NULL)))
|
||||
eprint("cannot open display\n");
|
||||
|
|
Loading…
Reference in a new issue