[Twisted-Python] tap2deb -v/--version bug

Tommi Virtanen tv at twistedmatrix.com
Tue Mar 4 07:10:00 MST 2003


	tap2deb --version option is overridden by global handling
	for --version that just displays the version number.

[0 tv at 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 at lapdog ~]$ tap2deb --version=42 -t foo.tap
/usr/bin/tap2deb: option --version must not have an argument
[1 tv at 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())



-- 
:(){ :|:&};:




More information about the Twisted-Python mailing list