diff options
author | oga <oga> | 2008-02-13 21:04:19 +0000 |
---|---|---|
committer | oga <oga> | 2008-02-13 21:04:19 +0000 |
commit | 9cb4f8884eb4f633d1d3983285aa1025c0ed7efc (patch) | |
tree | 88269096b640150eee4c9807a6601f63d1b2e03f /calmwm.c | |
parent | 09dbddac8750b72eb00950b3f1a20c3fb81c6240 (diff) | |
download | cwm-9cb4f8884eb4f633d1d3983285aa1025c0ed7efc.tar.gz cwm-9cb4f8884eb4f633d1d3983285aa1025c0ed7efc.tar.xz cwm-9cb4f8884eb4f633d1d3983285aa1025c0ed7efc.zip |
add usage() for when an unknown option is given.
from Gleydson Soares <gsoares@gmail.com>, thanks! ok jasper@
Diffstat (limited to 'calmwm.c')
-rw-r--r-- | calmwm.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/calmwm.c b/calmwm.c index 886ee32..7703221 100644 --- a/calmwm.c +++ b/calmwm.c @@ -71,7 +71,7 @@ main(int argc, char **argv) DefaultFontName = xstrdup(optarg); break; default: - errx(1, "Unknown option '%c'", ch); + usage(); } } argc -= optind; @@ -321,3 +321,12 @@ _sigchld_cb(int which) (pid < 0 && errno == EINTR)) ; } + +void +usage(void) +{ + extern char *__progname; + + fprintf(stderr, "usage: %s [-s] [-d display] [-f fontname] \n", __progname); + exit(1); +} |