summaryrefslogtreecommitdiffstats
path: root/dimension/main.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2011-03-16 18:06:14 -0400
committerTavian Barnes <tavianator@gmail.com>2011-03-16 18:06:14 -0400
commit70a62b2079168ef51369c0f7a7f3b95555c18c0f (patch)
treef076032142991c39b2d7f874ab8273aae20bfd34 /dimension/main.c
parent13c80f4cc4f0e26216c7f28dfd1ccf3bfd55faf8 (diff)
downloaddimension-70a62b2079168ef51369c0f7a7f3b95555c18c0f.tar.xz
Fix -? option handling.
Diffstat (limited to 'dimension/main.c')
-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;