summaryrefslogtreecommitdiff
path: root/python/subunit/_output.py
diff options
context:
space:
mode:
authorThomi Richards <thomi.richards@canonical.com>2013-11-19 14:45:03 +1300
committerThomi Richards <thomi.richards@canonical.com>2013-11-19 14:45:03 +1300
commit0111095cf3107071aeff699c460e248f87baf296 (patch)
tree355183996ae619bf946737c61301e70df94d528b /python/subunit/_output.py
parent4c80e88f4ae0e03a84dd53338b9e3dcc2c7fc625 (diff)
downloadsubunit-git-0111095cf3107071aeff699c460e248f87baf296.tar.gz
Made help/usage documentation much more useful.
Diffstat (limited to 'python/subunit/_output.py')
-rw-r--r--python/subunit/_output.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/python/subunit/_output.py b/python/subunit/_output.py
index ba6d0ce..fe4585f 100644
--- a/python/subunit/_output.py
+++ b/python/subunit/_output.py
@@ -41,6 +41,10 @@ def parse_arguments(args=None, ParserClass=ArgumentParser):
parser = ParserClass(
prog='subunit-output',
description="A tool to generate a subunit result byte-stream",
+ usage="""%(prog)s [-h] action [-h] test [--attach-file ATTACH_FILE]
+ [--mimetype MIMETYPE] [--tags TAGS]""",
+ epilog="""Additional help can be printed by passing -h to an action
+ (e.g.- '%(prog)s pass -h' will show help for the 'pass' action)."""
)
common_args = ParserClass(add_help=False)
@@ -66,7 +70,11 @@ def parse_arguments(args=None, ParserClass=ArgumentParser):
type=partial(split, sep=','),
default=None
)
- sub_parsers = parser.add_subparsers(dest="action")
+ sub_parsers = parser.add_subparsers(
+ dest="action",
+ title="actions",
+ description="These actions are supported by this tool",
+ )
final_state = "This is a final action: No more actions may be generated " \
"for this test id after this one."
@@ -80,7 +88,7 @@ def parse_arguments(args=None, ParserClass=ArgumentParser):
parser_pass = sub_parsers.add_parser(
"pass",
help="Pass a test. " + final_state,
- parents=[common_args]
+ parents=[common_args],
)
parser_fail = sub_parsers.add_parser(