[Twisted-Python] tap2deb -v/--version bug
tap2deb --version option is overridden by global handling for --version that just displays the version number. [0 tv@lapdog ~]$ tap2deb --help Usage: tap2deb [options] Options: -u, --unsigned -t, --tapfile= [default: twistd.tap] -m, --maintainer= [default: ] -p, --protocol= [default: ] -e, --description= [default: ] -l, --long_description= [default: ] -v, --version= [default: 1.0] -d, --debfile= -y, --type= type of configuration: 'tap', 'xml, 'source' or 'python' [default: tap] --help Display this help and exit. tap2deb [0 tv@lapdog ~]$ tap2deb --version=42 -t foo.tap /usr/bin/tap2deb: option --version must not have an argument [1 tv@lapdog ~]$ Here's a patch that changes the option to --set-version=, and the short option to -V. Please tell if you approve this change. diff -u -u -r1.9 tap2deb.py --- twisted/scripts/tap2deb.py 3 Oct 2002 07:56:14 -0000 1.9 +++ twisted/scripts/tap2deb.py 4 Mar 2003 14:09:13 -0000 @@ -26,7 +26,7 @@ ["protocol", "p", ""], ["description", "e", ""], ["long_description", "l", ""], - ["version", "v", "1.0"], + ["set-version", "V", "1.0"], ["debfile", "d", None], ["type", "y", "tap", "type of configuration: 'tap', 'xml, 'source' or 'python'"]] @@ -54,7 +54,7 @@ base_tap_file = os.path.basename(config['tapfile']) protocol = (config['protocol'] or os.path.splitext(base_tap_file)[0]) deb_file = config['debfile'] or 'twisted-'+protocol - version = config['version'] + version = config['set-version'] maintainer = config['maintainer'] description = config['description'] or ('A TCP server for %(protocol)s' % vars()) -- :(){ :|:&};:
On Tue, Mar 04, 2003 at 04:10:00PM +0200, Tommi Virtanen wrote:
tap2deb --version option is overridden by global handling for --version that just displays the version number.
Moshez said "go ahead and commit, but fix the manpage too", so I did just that. -- :(){ :|:&};:
Tommi Virtanen wrote:
Moshez said "go ahead and commit, but fix the manpage too", so I did just that.
I think manpages would ideally be generated from the source code. Then it would be easy to remember to do it, and maybe you wouldn't have to type a bunch of stuff twice. Might be prohibitively complex to implement, though. --Sam
On Wed, Mar 05, 2003 at 02:05:06PM -0500, Samuel Bronson wrote:
Tommi Virtanen wrote:
Moshez said "go ahead and commit, but fix the manpage too", so I did just that.
I think manpages would ideally be generated from the source code. Then it would be easy to remember to do it, and maybe you wouldn't have to type a bunch of stuff twice. Might be prohibitively complex to implement, though.
You're welcome to try :) I doubt you'll be able to generate a man page for mktap that's as good as the current one. One reason is that the descriptions of the various options is a bit longer in a man page than in the --help... I don't much like the duplication either, but I see no better alternative. -Andrew.
participants (3)
-
Andrew Bennetts
-
Samuel Bronson
-
Tommi Virtanen