Skip to content

Commit

Permalink
Fix error message with command sos -v (which is not supposed to be used)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo Peng committed Sep 13, 2017
1 parent c72b003 commit 31c15b5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/sos/__main__.py
Expand Up @@ -2210,6 +2210,10 @@ def main():
sys.exit('Cannot determine from or to format')
sys.argv.insert(2, '{}-{}'.format(from_format, to_format))
args, workflow_args = master_parser.parse_known_args()
if not hasattr(args, 'func'):
# in case of sos -v etc that no subcommand is specified
master_parser.print_help()
sys.exit(0)
# calling the associated functions
args.func(args, workflow_args)
except KeyboardInterrupt:
Expand Down

0 comments on commit 31c15b5

Please sign in to comment.