Skip to content

Commit

Permalink
Merge pull request #3124 from yarikoptic/bf-3118
Browse files Browse the repository at this point in the history
ENH: datalad --help   uses no man(page)
  • Loading branch information
mih committed Jan 16, 2019
2 parents a882677 + 107cd67 commit dd0a42c
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 dd0a42c

Please sign in to comment.