Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added 'pgxn help CMD' as synonim for 'pgxn CMD --help'

Fixes ticket #7
  • Loading branch information...
commit 645a735c670408e49cde41e93a1eb7cd05fe6967 1 parent f40afce
Daniele Varrazzo authored
Showing with 7 additions and 1 deletion.
  1. +1 −0  CHANGES
  2. +6 −1 pgxnclient/commands/help.py
1  CHANGES
View
@@ -2,6 +2,7 @@ pgxnclient 1.0.1
================
- Fixed simplejson dependency on Python 2.6 (ticket #8)
+- Added 'pgxn help CMD' as synonim for 'pgxn CMD --help' (ticket #7)
pgxnclient 1.0
7 pgxnclient/commands/help.py
View
@@ -26,6 +26,8 @@ def customize_parser(self, parser, subparsers, **kwargs):
help = _("list all the available commands"))
g.add_argument('--libexec', action="store_true",
help = _("print the location of the scripts directory"))
+ g.add_argument('command', metavar='CMD', nargs='?',
+ help = _("the command to get help about"))
# To print the basic help
self._parser = parser
@@ -33,7 +35,10 @@ def customize_parser(self, parser, subparsers, **kwargs):
return subp
def run(self):
- if self.opts.all:
+ if self.opts.command:
+ from pgxnclient.cli import main
+ main([self.opts.command, '--help'])
+ elif self.opts.all:
self.print_all_commands()
elif self.opts.libexec:
self.print_libexec()
Please sign in to comment.
Something went wrong with that request. Please try again.