cli: add support for deprecated tower-cli aliases in py2

This commit is contained in:
Ryan Petrello
2019-09-03 21:08:28 -04:00
parent ba8b876dd3
commit b888c4b75a
3 changed files with 30 additions and 4 deletions

View File

@@ -170,9 +170,9 @@ class CLI(object):
if formatted:
print(utils.to_str(formatted), file=self.stdout)
else:
self.parser.print_help()
if six.PY2 and not self.help:
if six.PY3:
self.parser.print_help()
elif six.PY2 and not self.help:
# Unfortunately, argparse behavior between py2 and py3
# changed in a notable way when required subparsers
# have invalid (or missing) arguments specified