changeset 12:db43d30afcf5

note pattern to use
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 26 Mar 2012 10:39:01 -0700
parents e00afe2c83bf
children 0f8115a41ad6
files configuration/config.py
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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[:]):