aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@yeah.nah.nz>2019-03-11 16:36:16 +1300
committerDavid Phillips <david@yeah.nah.nz>2019-03-11 16:36:16 +1300
commit0959ba2096e46b44785eeb643363247002aee52d (patch)
tree90d58d8dfa07b47fe4f8a8da3b4aa53d096503bc
parentb6f427e2f75a39d1d64146302828f54de87d02aa (diff)
downloadsand-leek-0959ba2096e46b44785eeb643363247002aee52d.tar.xz
Display usage on invalid opt
-rw-r--r--sand-leek.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sand-leek.c b/sand-leek.c
index da51078..2afbf10 100644
--- a/sand-leek.c
+++ b/sand-leek.c
@@ -378,7 +378,7 @@ main(int argc, char **argv) {
pthread_t *workers = NULL;
volatile unsigned long *khashes = NULL;
- while ((opt = getopt(argc, argv, "t:s:VA")) != -1) {
+ while ((opt = getopt(argc, argv, "ht:s:VA")) != -1) {
switch (opt) {
case 'V':
show_version();
@@ -393,8 +393,9 @@ main(int argc, char **argv) {
no_ansi_esc = 1;
break;
case '?':
+ case 'h':
default:
- return 1;
+ die_usage(argv[0]);
break; /* unreachable */
}
}