113
113
SHORT_OPTIONS = {}
115
def __init__(self, name, help='', type=None, argname=None):
115
def __init__(self, name, help='', type=None):
116
116
"""Make a new command option.
118
118
name -- regular name of the command, used in the double-dash
124
124
type -- function called to parse the option argument, or
125
125
None (default) if this option doesn't take an argument.
127
argname -- name of option argument, if any
129
127
# TODO: perhaps a subclass that automatically does
130
128
# --option, --no-option for reversable booleans
135
assert argname is None
136
elif argname is None:
138
self.argname = argname
140
133
def short_name(self):
141
134
"""Return the single character option for this command, if any.
150
143
Option.OPTIONS[name] = Option(name, **kwargs)
152
145
_global_option('all')
153
_global_option('clobber')
154
146
_global_option('basis', type=str)
155
147
_global_option('diff-options', type=str)
156
_global_option('help',
157
help='show help message')
148
_global_option('help')
158
149
_global_option('file', type=unicode)
159
150
_global_option('force')
160
151
_global_option('format', type=unicode)
161
152
_global_option('forward')
162
153
_global_option('message', type=unicode)
163
154
_global_option('no-recurse')
164
_global_option('profile',
165
help='show performance profiling information')
155
_global_option('profile')
166
156
_global_option('revision', type=_parse_revision_str)
167
157
_global_option('short')
168
_global_option('show-ids',
169
help='show internal object ids')
170
_global_option('timezone',
172
help='display timezone as local, original, or utc')
173
_global_option('verbose',
174
help='display more information')
158
_global_option('show-ids')
159
_global_option('timezone', type=str)
160
_global_option('verbose')
175
161
_global_option('version')
176
162
_global_option('email')
163
_global_option('unchanged')
177
164
_global_option('update')
178
165
_global_option('long')
179
166
_global_option('root', type=str)