aboutsummaryrefslogtreecommitdiffstats
path: root/calmwm.c
diff options
context:
space:
mode:
authoroga2008-02-13 21:04:19 +0000
committeroga2008-02-13 21:04:19 +0000
commitcf4822fb8f31ac4f586d1ccd678696502a9a05b5 (patch)
tree45030d9797469473bd1b1ca2d8e6b5185946c102 /calmwm.c
parent04d5150e6363273e7382d4a360e8e8baf3582fd6 (diff)
downloadcwm-cf4822fb8f31ac4f586d1ccd678696502a9a05b5.tar.gz
add usage() for when an unknown option is given.
from Gleydson Soares <gsoares@gmail.com>, thanks! ok jasper@
Diffstat (limited to '')
-rw-r--r--calmwm.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/calmwm.c b/calmwm.c
index 1633c30..2ae813d 100644
--- a/calmwm.c
+++ b/calmwm.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $Id: calmwm.c,v 1.8 2008/02/13 12:09:47 oga Exp $
+ * $Id: calmwm.c,v 1.9 2008/02/13 21:04:19 oga Exp $
*/
#include "headers.h"
@@ -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);
+}