Show More
@@ -5,7 +5,8 b'' | |||
|
5 | 5 | # This software may be used and distributed according to the terms of the |
|
6 | 6 | # GNU General Public License version 2 or any later version. |
|
7 | 7 | |
|
8 | import getopt | |
|
8 | import getopt, util | |
|
9 | from i18n import _ | |
|
9 | 10 | |
|
10 | 11 | def gnugetopt(args, options, longoptions): |
|
11 | 12 | """Parse options mostly like getopt.gnu_getopt. |
@@ -105,7 +106,11 b' def fancyopts(args, options, state, gnu=' | |||
|
105 | 106 | if t is type(fancyopts): |
|
106 | 107 | state[name] = defmap[name](val) |
|
107 | 108 | elif t is type(1): |
|
109 | try: | |
|
108 | 110 | state[name] = int(val) |
|
111 | except ValueError: | |
|
112 | raise util.Abort(_('invalid value %r for option %s, ' | |
|
113 | 'expected int') % (val, opt)) | |
|
109 | 114 | elif t is type(''): |
|
110 | 115 | state[name] = val |
|
111 | 116 | elif t is type([]): |
General Comments 0
You need to be logged in to leave comments.
Login now