diff options
-rw-r--r-- | marsond.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -108,7 +108,7 @@ void parse_args(int argc, char **argv) { } } - while( (opt = getopt(argc, argv, "d:hfk:p:vV")) != -1) { + while( (opt = getopt(argc, argv, ":d:hfk:p:vV")) != -1) { switch(opt) { case 'd': delay_ms = atoi(optarg); break; case 'f': foreground++; break; @@ -117,7 +117,8 @@ void parse_args(int argc, char **argv) { case 'p': pause_ms = atoi(optarg); break; case 'v': debugging++; break; case 'V': version(); exit(0); break; - default: die("invalid option (try --help)"); break; + case ':': die("option -%c requires an argument (try --help)", optopt); break; + default: die("invalid option -%c (try --help)", optopt); break; } } |