Python 3 support for certonly

This commit is contained in:
Yen Chi Hsuan
2016-07-30 23:07:02 +08:00
parent b08a3eb7ba
commit 8a09a7ed67
8 changed files with 26 additions and 14 deletions
+4 -2
View File
@@ -343,8 +343,10 @@ class HelpfulArgumentParser(object):
self.determine_verb()
help1 = self.prescan_for_flag("-h", self.help_topics)
help2 = self.prescan_for_flag("--help", self.help_topics)
assert max(True, "a") == "a", "Gravity changed direction"
self.help_arg = max(help1, help2)
if isinstance(help1, bool) and isinstance(help2, bool):
self.help_arg = help1 or help2
else:
self.help_arg = help1 if isinstance(help1, str) else help2
if self.help_arg is True:
# just --help with no topic; avoid argparse altogether
print(usage)