comparison README.txt @ 70:451aeb35ec04

outline what options are available for ``value``
author Jeff Hammel <jhammel@mozilla.com>
date Wed, 28 Mar 2012 11:18:13 -0700
parents 1025d283a570
children c39ca7020da7
comparison
equal deleted inserted replaced
69:92c11cd1d27e 70:451aeb35ec04
19 {'name': {<value>}} 19 {'name': {<value>}}
20 20
21 ``name`` is the name of the configuration option, and ``value`` is a 21 ``name`` is the name of the configuration option, and ``value`` is a
22 ``dict`` that gives the form of the option. 22 ``dict`` that gives the form of the option.
23 23
24 ``Configuration`` transforms these options into ``OptionParser`` options.
25
26 Options for ``value`` include:
27
28 * help : what the option is about (translated to command line help)
29 * default: default value for the option
30 * required: if a true value, this option must be present in the
31 configuration. If ``required`` is a string, it will be displayed if
32 the option is not present. If the default is defined, you won't
33 need required as the default value will be used
34 * type: type of the option. Used to control the parsing of the option
35 * flags: a list that, if present, will be used for the command line
36 flags. Othwise, the option name prepended by ``--`` will be used.
37 To disable as a command line option, use an empty list ``[]``
38
39 In addition, you may extend ``Configuration`` and have additional
40 useful items in the ``value`` dict for ``options``.
24 41
25 For an example, see 42 For an example, see
26 http://k0s.org/mozilla/hg/configuration/file/c831eb58fb52/tests/example.py#l7 43 http://k0s.org/mozilla/hg/configuration/file/c831eb58fb52/tests/example.py#l7
27 44
28 45