Skip to content

Commit

Permalink
ENH: datalad --help uses no man(page)
Browse files Browse the repository at this point in the history
  • Loading branch information
yarikoptic committed Jan 16, 2019
1 parent 0d63043 commit 107cd67
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions datalad/cmdline/helpers.py
Expand Up @@ -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
Expand Down

0 comments on commit 107cd67

Please sign in to comment.