# HG changeset patch # User Jeff Hammel # Date 1332783541 25200 # Node ID db43d30afcf5151ebe35cc8e2b2c320f17acd677 # Parent e00afe2c83bf5c5ec201a5fbe599f4cf973b7376 note pattern to use diff -r e00afe2c83bf -r db43d30afcf5 configuration/config.py --- a/configuration/config.py Mon Mar 26 09:45:06 2012 -0700 +++ b/configuration/config.py Mon Mar 26 10:39:01 2012 -0700 @@ -99,11 +99,18 @@ if not args: continue - kw = {} + kw = {'dest': key} help = value.get('help', key) - # TODO: types + if 'default' in value: - raise NotImplementedError("TODO") + kw['default'] = value['default'] + # TODO: use default pattern a la + # - http://hg.mozilla.org/build/talos/file/c6013a2f09ce/talos/PerfConfigurator.py#l358 + # - http://k0s.org/mozilla/hg/bzconsole/file/d5e88dadde69/bzconsole/command.py#l12 + + help += ' [DEFAULT: %s]' % value['default'] + kw['action'] = 'store' # TODO: types + parser.add_option(*args, **kw) def main(args=sys.argv[:]):