bisect-kit: show bisector's file docstring as command line help
BUG=chromium:776314
TEST=./bisect_git.py --help
Change-Id: I472c61e3aa0d11b882b770b68707b56831ee274e
Reviewed-on: https://chromium-review.googlesource.com/778682
Commit-Ready: Kuang-che Wu <kcwu@chromium.org>
Tested-by: Kuang-che Wu <kcwu@chromium.org>
Reviewed-by: Owen Lin <owenlin@chromium.org>
diff --git a/bisect_kit/cli.py b/bisect_kit/cli.py
index 4a87c32..d39ab89 100644
--- a/bisect_kit/cli.py
+++ b/bisect_kit/cli.py
@@ -631,15 +631,19 @@
self.states.save()
def create_argument_parser(self, prog):
+ if self.domain_cls.help:
+ description = self.domain_cls.help
+ else:
+ description = 'Bisector for %s' % self.domain_cls.__name__
+ description += textwrap.dedent('''
+ When running switcher and evaluator, it will set BISECT_REV environment
+ variable, indicates current rev to switch/evaluate.
+ ''')
+
parser = argparse.ArgumentParser(
prog=prog,
formatter_class=argparse.RawDescriptionHelpFormatter,
- description=textwrap.dedent('''\
- Bisector for %s.
-
- When running switcher and evaluator, it will set BISECT_REV environment
- variable, indicates current rev to switch/evaluate.
- ''' % self.domain_cls.__name__) + textwrap.dedent(self.domain_cls.help))
+ description=description)
common.add_common_arguments(parser)
parser.add_argument(
'--session_base',