aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-10-01 17:00:56 +0200
committerThomas White <taw@physics.org>2019-03-11 16:49:36 +0100
commit95e4bb31cb32d684dfdafaf3f0e76fb17541fe26 (patch)
tree1cbe33d815bced52edc1da4ac0bfe5b2bdb45d54 /src
parentcd9951423216c429755954e671cac2111eedb953 (diff)
cell_tool: Improve option processing
Diffstat (limited to 'src')
-rw-r--r--src/cell_tool.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/cell_tool.c b/src/cell_tool.c
index beb03597..8453c9f7 100644
--- a/src/cell_tool.c
+++ b/src/cell_tool.c
@@ -378,10 +378,25 @@ int main(int argc, char *argv[])
}
+ /* If there's a parameter left over, we assume it's the unit cell */
+ if ( (argc > optind) && (cell_file == NULL) ) {
+ cell_file = strdup(argv[optind++]);
+ }
+
+ /* If there's STILL a parameter left over, complain*/
+ if ( argc > optind ) {
+ ERROR("Excess command-line arguments:\n");
+ do {
+ ERROR("'%s'\n", argv[optind++]);
+ } while ( argc > optind );
+ return 1;
+ }
+
if ( cell_file == NULL ) {
ERROR("You must give a filename for the unit cell PDB file.\n");
return 1;
}
+ STATUS("Input unit cell: %s\n", cell_file);
cell = load_cell_from_file(cell_file);
if ( cell == NULL ) {
ERROR("Failed to load cell from '%s'\n", cell_file);