mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
add usage() for when an unknown option is given.
from Gleydson Soares <gsoares@gmail.com>, thanks! ok jasper@
This commit is contained in:
parent
09dbddac87
commit
9cb4f8884e
11
calmwm.c
11
calmwm.c
@ -71,7 +71,7 @@ main(int argc, char **argv)
|
|||||||
DefaultFontName = xstrdup(optarg);
|
DefaultFontName = xstrdup(optarg);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
errx(1, "Unknown option '%c'", ch);
|
usage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
argc -= optind;
|
argc -= optind;
|
||||||
@ -321,3 +321,12 @@ _sigchld_cb(int which)
|
|||||||
(pid < 0 && errno == EINTR))
|
(pid < 0 && errno == EINTR))
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
usage(void)
|
||||||
|
{
|
||||||
|
extern char *__progname;
|
||||||
|
|
||||||
|
fprintf(stderr, "usage: %s [-s] [-d display] [-f fontname] \n", __progname);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
1
calmwm.h
1
calmwm.h
@ -312,6 +312,7 @@ int x_errorhandler(Display *, XErrorEvent *);
|
|||||||
void x_setup(char *display_name);
|
void x_setup(char *display_name);
|
||||||
char *x_screenname(int);
|
char *x_screenname(int);
|
||||||
void x_setupscreen(struct screen_ctx *, u_int);
|
void x_setupscreen(struct screen_ctx *, u_int);
|
||||||
|
void usage(void);
|
||||||
|
|
||||||
struct client_ctx *client_find(Window);
|
struct client_ctx *client_find(Window);
|
||||||
void client_setup(void);
|
void client_setup(void);
|
||||||
|
Loading…
Reference in New Issue
Block a user