From 107cd6748509d543561b4ea1737abf7d0b4353db Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 15 Jan 2019 23:23:07 -0500 Subject: [PATCH] ENH: datalad --help uses no man(page) --- datalad/cmdline/helpers.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/datalad/cmdline/helpers.py b/datalad/cmdline/helpers.py index d441a6dfc5..527286e58d 100644 --- a/datalad/cmdline/helpers.py +++ b/datalad/cmdline/helpers.py @@ -33,8 +33,15 @@ class HelpAction(argparse.Action): def __call__(self, parser, namespace, values, option_string=None): - if is_interactive() and option_string == '--help': - # lets use the manpage on mature systems ... + # Lets use the manpage on mature systems but only for subcommands -- + # --help should behave similar to how git does it: + # regular --help for "git" but man pages for specific commands. + # It is important since we do discover all subcommands from entry + # points at run time and thus any static manpage would like be out of + # date + if is_interactive() \ + and option_string == '--help' \ + and ' ' in parser.prog: # subcommand try: import subprocess # get the datalad manpage to use