Skip to content

Commit

Permalink
Merge pull request iterative#15 from dmpetrov/elh_bug
Browse files Browse the repository at this point in the history
bug -- where do command arguments start in argv
  • Loading branch information
earlh authored Apr 10, 2017
2 parents cdc189d + 84d0a5d commit 12ff96f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dvc2.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,17 @@ def print_usage():
else:
subcmd = sys.argv[2]

argv_offset = 1 + (0 if subcmd == None else 1)
if cmd == 'init':
Runtime.run(CmdRun, args_start_loc=2)
elif cmd == 'run':
Runtime.run(CmdDataImport, args_start_loc=2)
elif cmd == 'repro':
Runtime.run(CmdRepro, args_start_loc=2)
elif cmd == 'data-sync' or (cmd == 'data' and subcmd == 'sync'):
Runtime.run(CmdDataSync, args_start_loc=2)
Runtime.run(CmdDataSync, args_start_loc=argv_offset)
elif cmd == 'data-import' or (cmd == 'data' and subcmd == 'import'):
Runtime.run(CmdDataImport, args_start_loc=2)
Runtime.run(CmdDataImport, args_start_loc=argv_offset)
elif cmd == 'cloud-run' or (cmd == 'cloud' and subcmd == 'run'):
print('cloud-run unimplemented')
elif cmd == 'cloud-instance-create' or (cmd == 'cloud' and subcmd == 'instance-create'):
Expand Down

0 comments on commit 12ff96f

Please sign in to comment.