Skip to content

Commit 62785b7

Browse files
author
Will Trimble
committed
Fixed mistake in argparse transition nargs=+
1 parent ed61176 commit 62785b7

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

scripts/mg-submit.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ def main(args):
460460
parser.add_argument("--tmp_dir", dest="tmp_dir", default="", help="Temp dir to download too if using json_in option, default is current working dir")
461461
parser.add_argument("-v", "--verbose", dest="verbose", action="store_true", default=False, help="Verbose STDOUT")
462462
parser.add_argument("--debug", dest="debug", action="store_true", default=False, help="Submit in debug mode")
463-
parser.add_argument("action", type=str, default=False, help="Action. One of "+ ",".join(valid_actions))
463+
parser.add_argument("action", type=str, default=False, help="Action. One of "+ ",".join(valid_actions), nargs='+')
464464
# parser.add_argument("subaction", type=str, default=False, help="Action word 2", default=None)
465465

466466
# get inputs
@@ -474,7 +474,7 @@ def main(args):
474474
if len(opts.action) < 1:
475475
sys.stderr.write("ERROR: missing action\n")
476476
return 1
477-
action = opts.action
477+
action = opts.action[0]
478478
args = opts.action
479479
API_URL = opts.mgrast_url
480480
SHOCK_URL = opts.shock_url
@@ -494,9 +494,9 @@ def main(args):
494494
sys.stderr.write("ERROR: invalid submit, must have one of project_id, project_name, or metadata\n")
495495
return 1
496496
if (len(args) < 2) or (args[1] not in submit_types):
497-
sys.stderr.write("ERROR: invalid submit option. use one of: %s\n"%", ".join(submit_types))
497+
sys.stderr.write("ERROR: invalid submit option '%s'. use one of: %s\n"%( args[1], ", ".join(submit_types)))
498498
return 1
499-
if ((args[1] == "simple") and (len(args) < 3) or
499+
if ( ((args[1] == "simple") and (len(args) < 3)) or
500500
((args[1] == "batch") and (len(args) != 3)) or
501501
((args[1] == "demultiplex") and (len(args) < 3)) or
502502
((args[1] == "pairjoin") and (len(args) != 4)) or

0 commit comments

Comments
 (0)