Skip to content

Commit

Permalink
Merge pull request #14 from abanna/bug_fix_cli_command_error
Browse files Browse the repository at this point in the history
fixing issue with python 3.4 arg parse. will now display usage if no …
  • Loading branch information
davidremm committed Feb 24, 2016
2 parents b6709c5 + 750fdba commit ffc4ca7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions bin/freight-forwarder
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,13 @@ def main():
elif item.startswith('-') or item.startswith('--'):
msg.append(item)

raise AttributeError(logger.error("The following are not valid options: {0}".format(', '.join(msg))))
else:
args.func(args)
logger.error("The following are not valid options: {0}".format(', '.join(msg)))
raise AttributeError()

elif hasattr(args, 'func'):
args.func(args)
else:
parser.print_usage()

if __name__ == '__main__':
start_time = time.time()
Expand Down

0 comments on commit ffc4ca7

Please sign in to comment.