summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dimension/main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/dimension/main.c b/dimension/main.c
index ee2e680..6e40c08 100644
--- a/dimension/main.c
+++ b/dimension/main.c
@@ -82,7 +82,12 @@ main(int argc, char **argv)
case '?':
print_usage(stdout, argv[0]);
- return EXIT_SUCCESS;
+ /* '?' is returned as an error code too */
+ if (optopt == 0) {
+ return EXIT_SUCCESS;
+ } else {
+ return EXIT_FAILURE;
+ }
case DMNSN_OPT_VERSION:
print_version(stdout);
return EXIT_SUCCESS;