aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2018-11-28 08:18:01 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2018-11-28 08:18:01 +0530
commit8cba83f43f7fca3f73698872da4e7f7c03faea38 (patch)
tree314525ab277dad868b31d3233f5a14f95a7faeb6
parent2a4cc85659f247704811da02338a8137908522b8 (diff)
downloadnnn-8cba83f43f7fca3f73698872da4e7f7c03faea38.tar.gz
Return 1 on unrecognized option
-rw-r--r--src/nnn.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 93d4c32..4f3a822 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -3437,7 +3437,6 @@ static void usage(void)
" -v show program version\n"
" -h show this help\n\n"
"Version: %s\n%s\n", VERSION, GENERAL_INFO);
- exit(0);
}
int main(int argc, char *argv[])
@@ -3494,9 +3493,12 @@ int main(int argc, char *argv[])
case 'v':
fprintf(stdout, "%s\n", VERSION);
return 0;
- case 'h': // fallthrough
+ case 'h':
+ usage();
+ return 0;
default:
usage();
+ exit(1);
}
}