diff options
author | Thomas White <taw@bitwiz.org.uk> | 2012-09-04 11:48:27 +0200 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2012-09-04 11:48:53 +0200 |
commit | fbe8b2e1cd1111b440b769eb62ffcd4711b24839 (patch) | |
tree | 7d313e6e199a6653c3d4c025c0c943e5cc0587f9 /src/process_hkl.c | |
parent | 9745feca8bc787f3441e961de9b140200242f2f0 (diff) |
Fix widespread bug-hiding problem with command line argument handling
Diffstat (limited to 'src/process_hkl.c')
-rw-r--r-- | src/process_hkl.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/process_hkl.c b/src/process_hkl.c index 28d54360..8048cf45 100644 --- a/src/process_hkl.c +++ b/src/process_hkl.c @@ -390,43 +390,46 @@ int main(int argc, char *argv[]) longopts, NULL)) != -1) { switch (c) { - case 'h' : + + case 'h' : show_help(argv[0]); return 0; - case 'i' : + case 'i' : filename = strdup(optarg); break; - case 'o' : + case 'o' : output = strdup(optarg); break; - case 's' : + case 's' : config_stopafter = atoi(optarg); break; - case 'f' : + case 'f' : config_startafter = atoi(optarg); break; - case 'y' : + case 'y' : sym_str = strdup(optarg); break; - case 'g' : + case 'g' : histo = strdup(optarg); break; - case 'z' : + case 'z' : histo_params = strdup(optarg); break; - case 0 : + case 0 : + break; + + default : + ERROR("Unhandled option '%c'\n", c); break; - default : - return 1; } } |