diff options
author | Thomas White <taw@physics.org> | 2011-03-04 20:10:08 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:27:17 +0100 |
commit | 57dba87d11224b41c9799cf507019e15e3450e6c (patch) | |
tree | e301a25fd5e489c4999f90d95f46da3a91f4c280 /src | |
parent | 88143956bd9a15c402d171c28e64943e74c7d011 (diff) |
indexamajig: Allow --indexing=none
Diffstat (limited to 'src')
-rw-r--r-- | src/indexamajig.c | 69 |
1 files changed, 39 insertions, 30 deletions
diff --git a/src/indexamajig.c b/src/indexamajig.c index 1bcfaf0e..fe9f95b8 100644 --- a/src/indexamajig.c +++ b/src/indexamajig.c @@ -592,41 +592,50 @@ int main(int argc, char *argv[]) return 1; } - if ( indm_str == NULL ) { - STATUS("You didn't specify an indexing method, so I won't" - " try to index anything.\n" - "If that isn't what you wanted, re-run with" - " --indexing=<method>.\n"); - indm = NULL; + if ( strcmp(indm_str, "none") == 0 ) { + STATUS("Not indexing anything.\n"); indexer_needs_cell = 0; + reduction_needs_cell = 0; + indm = NULL; + cellr = CELLR_NONE; } else { - indm = build_indexer_list(indm_str, &indexer_needs_cell); - if ( indm == NULL ) { - ERROR("Invalid indexer list '%s'\n", indm_str); - return 1; + if ( indm_str == NULL ) { + STATUS("You didn't specify an indexing method, so I " + " won't try to index anything.\n" + "If that isn't what you wanted, re-run with" + " --indexing=<method>.\n"); + indm = NULL; + indexer_needs_cell = 0; + } else { + indm = build_indexer_list(indm_str, &indexer_needs_cell); + if ( indm == NULL ) { + ERROR("Invalid indexer list '%s'\n", indm_str); + return 1; + } + free(indm_str); } - free(indm_str); - } - reduction_needs_cell = 0; - if ( scellr == NULL ) { - STATUS("You didn't specify a cell reduction method, so I'm" - " going to use 'reduce'.\n"); - cellr = CELLR_REDUCE; - reduction_needs_cell = 1; - } else if ( strcmp(scellr, "none") == 0 ) { - cellr = CELLR_NONE; - } else if ( strcmp(scellr, "reduce") == 0) { - cellr = CELLR_REDUCE; - reduction_needs_cell = 1; - } else if ( strcmp(scellr, "compare") == 0) { - cellr = CELLR_COMPARE; - reduction_needs_cell = 1; - } else { - ERROR("Unrecognised cell reduction method '%s'\n", scellr); - return 1; + reduction_needs_cell = 0; + if ( scellr == NULL ) { + STATUS("You didn't specify a cell reduction method, so" + " I'm going to use 'reduce'.\n"); + cellr = CELLR_REDUCE; + reduction_needs_cell = 1; + } else if ( strcmp(scellr, "none") == 0 ) { + cellr = CELLR_NONE; + } else if ( strcmp(scellr, "reduce") == 0) { + cellr = CELLR_REDUCE; + reduction_needs_cell = 1; + } else if ( strcmp(scellr, "compare") == 0) { + cellr = CELLR_COMPARE; + reduction_needs_cell = 1; + } else { + ERROR("Unrecognised cell reduction method '%s'\n", + scellr); + return 1; + } + free(scellr); /* free(NULL) is OK. */ } - free(scellr); /* free(NULL) is OK. */ /* No indexing -> no reduction */ if ( indm == NULL ) reduction_needs_cell = 0; |