Commit ebe3f69e authored by Jim Fulton's avatar Jim Fulton

- buildout options can be given on the command line using the form::

    option_name=value

  as a short-hand for::

    buildout:option_name=value
parent 249f8f43
...@@ -4,6 +4,14 @@ Change History ...@@ -4,6 +4,14 @@ Change History
2.0.0a8 (2013-01-??) 2.0.0a8 (2013-01-??)
==================== ====================
- buildout options can be given on the command line using the form::
option_name=value
as a short-hand for::
buildout:option_name=value
- The ``versions`` option now defaults to ``versions``, so you no - The ``versions`` option now defaults to ``versions``, so you no
longer need to include:: longer need to include::
......
...@@ -1719,9 +1719,12 @@ def main(args=None): ...@@ -1719,9 +1719,12 @@ def main(args=None):
_error("Invalid option", '-'+op[0]) _error("Invalid option", '-'+op[0])
elif '=' in args[0]: elif '=' in args[0]:
option, value = args.pop(0).split('=', 1) option, value = args.pop(0).split('=', 1)
if len(option.split(':')) != 2: option = option.split(':')
if len(option) == 1:
option = 'buildout', option[0]
elif len(option) != 2:
_error('Invalid option:', option) _error('Invalid option:', option)
section, option = option.split(':') section, option = option
options.append((section.strip(), option.strip(), value.strip())) options.append((section.strip(), option.strip(), value.strip()))
else: else:
# We've run out of command-line options and option assignnemnts # We've run out of command-line options and option assignnemnts
......
...@@ -1947,6 +1947,14 @@ Assignments are of the form:: ...@@ -1947,6 +1947,14 @@ Assignments are of the form::
section_name:option_name=value section_name:option_name=value
Or::
option_name=value
which is equivalent to::
buildout:option_name=value
Options and assignments can be given in any order. Options and assignments can be given in any order.
Here's an example: Here's an example:
......
...@@ -2831,6 +2831,12 @@ def error_building_in_offline_mode_if_dont_have_needed_dist(): ...@@ -2831,6 +2831,12 @@ def error_building_in_offline_mode_if_dont_have_needed_dist():
<BLANKLINE> <BLANKLINE>
""" """
def test_buildout_section_shorthand_for_command_line_assignments():
r"""
>>> write('buildout.cfg', '')
>>> print_(system(buildout+' parts='), end='') # doctest: +ELLIPSIS
"""
###################################################################### ######################################################################
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment