Skip to content

Commit

Permalink
Fix rueckstiess#749: mlaunch with no options should show --help
Browse files Browse the repository at this point in the history
  • Loading branch information
stennie committed Dec 23, 2019
1 parent be64f16 commit b21d684
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions mtools/mlaunch/mlaunch.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,12 +535,17 @@ def is_file(arg):
"single nodes.")

# replace path with absolute path, but store relative path as well
self.relative_dir = self.args['dir']
self.dir = os.path.abspath(self.args['dir'])
self.args['dir'] = self.dir

# branch out in sub-commands
getattr(self, self.args['command'])()
if ('dir' in self.args and self.args['dir']):
self.relative_dir = self.args['dir']
self.dir = os.path.abspath(self.args['dir'])
self.args['dir'] = self.dir

if (self.args['command'] is None):
self.argparser.print_help()
self.argparser.exit()
else:
# branch out in sub-commands
getattr(self, self.args['command'])()

# -- below are the main commands: init, start, stop, list, kill
def init(self):
Expand Down

0 comments on commit b21d684

Please sign in to comment.