[PATCH 0 of 1] Display type of each command options in online help document.

FUJIWARA Katsunori fujiwara at ascade.co.jp
Wed Dec 31 00:03:25 CST 2008


At Tue, 30 Dec 2008 16:38:53 +0100,
Martin Geisler wrote:

> > Current online help displays:
> >
> >  -f --force      force push
> >  -r --rev        a specific revision up to which you would like to push
> >  -e --ssh        specify ssh command to use
> >
> > This patch changes it to:
> >
> >  -f --force     [F] force push
> >  -r --rev       [M] a specific revision up to which you would like to push
> >  -e --ssh       [V] specify ssh command to use
> 
> Instead of a non-standard format, I would prefer the output from the
> standard optparse module. For the push command the options could be
> declared like this:
> 
> From optparse import OptionParser
> parser = OptionParser()
> parser.add_option("-f", "--force", help="force push", action="store_true")
> parser.add_option("-r", "--rev",
>                   help="a specific revision up to which you would like to push")
> parser.add_option("-e", "--ssh", help="specify ssh command to use")
> parser.add_option("--remotecmd", metavar="CMD",
>                   help="specify hg command to run on the remote side")
> parser.parse_args()
> 
> Running the script with -h on the command line gives:
> 
> Options:
>   -h, --help         show this help message and exit
>   -f, --force        force push
>   -r REV, --rev=REV  a specific revision up to which you would like to push
>   -e SSH, --ssh=SSH  specify ssh command to use
>   --remotecmd=CMD    specify hg command to run on the remote side

Thank you for your comment about my idea.

And please give me time to check optparse module and brush my patch up.

----------------
[FUJIWARA Katsunori] fujiwara at ascade.co.jp(foozy at lares.dti.ne.jp)



More information about the Mercurial-devel mailing list