Skip to content

Commit f70dca2

Browse files
authored
scenarios: only print 'outer' help (#522)
Close #512
1 parent 9ff0bba commit f70dca2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

resources/scenarios/commander.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,14 @@ def setup(self):
131131
self.success = TestStatus.PASSED
132132

133133
def parse_args(self):
134+
# Only print "outer" args from parent class when using --help
135+
help_parser = argparse.ArgumentParser(usage="%(prog)s [options]")
136+
self.add_options(help_parser)
137+
help_args, _ = help_parser.parse_known_args()
138+
if help_args.help:
139+
help_parser.print_help()
140+
sys.exit(0)
141+
134142
previous_releases_path = ""
135143
parser = argparse.ArgumentParser(usage="%(prog)s [options]")
136144
parser.add_argument(

0 commit comments

Comments
 (0)