Permalink
Browse files

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

Fixes ticket #7
  • Loading branch information...
1 parent f40afce commit 645a735c670408e49cde41e93a1eb7cd05fe6967 @dvarrazzo committed Nov 28, 2011
Showing with 7 additions and 1 deletion.
  1. +1 −0 CHANGES
  2. +6 −1 pgxnclient/commands/help.py
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
@@ -26,14 +26,19 @@ 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
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()

0 comments on commit 645a735

Please sign in to comment.