diff options
author | Tavian Barnes <tavianator@gmail.com> | 2011-03-16 18:06:14 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2011-03-16 18:06:14 -0400 |
commit | 70a62b2079168ef51369c0f7a7f3b95555c18c0f (patch) | |
tree | f076032142991c39b2d7f874ab8273aae20bfd34 /dimension | |
parent | 13c80f4cc4f0e26216c7f28dfd1ccf3bfd55faf8 (diff) | |
download | dimension-70a62b2079168ef51369c0f7a7f3b95555c18c0f.tar.xz |
Fix -? option handling.
Diffstat (limited to 'dimension')
-rw-r--r-- | dimension/main.c | 7 |
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; |