diff options
| author | Mark McLoughlin <markmc@redhat.com> | 2012-11-12 16:25:52 -0500 |
|---|---|---|
| committer | Mark McLoughlin <markmc@redhat.com> | 2012-11-15 05:36:37 -0500 |
| commit | 5afead09dd98b41cdf3dbe62e1ccfd95a54f7c00 (patch) | |
| tree | 49778ba2f9c02207de132aa3d57104e1f6a60bdf /openstack | |
| parent | 5f564b24be4592c5212c492e6d67d9f4616229d2 (diff) | |
| download | oslo-5afead09dd98b41cdf3dbe62e1ccfd95a54f7c00.tar.gz oslo-5afead09dd98b41cdf3dbe62e1ccfd95a54f7c00.tar.xz oslo-5afead09dd98b41cdf3dbe62e1ccfd95a54f7c00.zip | |
Completely remove cfg's disable_interspersed_args()
The use case for disable_interspersed_args() is that nova-manage
needs to be able to parse sub-commands. We now have a
add_cli_subparsers() method which better supports this use case.
Change-Id: I1fcd15889745fe4ddff0ac4bacf385004f9b61af
Diffstat (limited to 'openstack')
| -rw-r--r-- | openstack/common/cfg.py | 44 |
1 files changed, 1 insertions, 43 deletions
diff --git a/openstack/common/cfg.py b/openstack/common/cfg.py index c256ca7..ee5fd4f 100644 --- a/openstack/common/cfg.py +++ b/openstack/common/cfg.py @@ -205,21 +205,7 @@ Option values may reference other values using PEP 292 string substitution:: Note that interpolation can be avoided by using '$$'. -For command line utilities that dispatch to other command line utilities, the -disable_interspersed_args() method is available. If this this method is called, -then parsing e.g.:: - - script --verbose cmd --debug /tmp/mything - -will no longer return:: - - ['cmd', '/tmp/mything'] - -as the leftover arguments, but will instead return:: - - ['cmd', '--debug', '/tmp/mything'] - -i.e. argument parsing is stopped at the first non-option argument. +FIXME(markmc): document add_cli_subparsers() Options may be declared as required so that an error is raised if the user does not supply a value for the option. @@ -1055,7 +1041,6 @@ class ConfigOpts(collections.Mapping): self._cli_values = {} self.__cache = {} self._config_opts = [] - self._disable_interspersed_args = False def _pre_setup(self, project, prog, version, usage, default_config_files): """Initialize a ConfigCliParser object for option parsing.""" @@ -1404,33 +1389,6 @@ class ConfigOpts(collections.Mapping): info.pop('default', None) info.pop('override', None) - def disable_interspersed_args(self): - """Set parsing to stop on the first non-option. - - If this this method is called, then parsing e.g. - - script --verbose cmd --debug /tmp/mything - - will no longer return: - - ['cmd', '/tmp/mything'] - - as the leftover arguments, but will instead return: - - ['cmd', '--debug', '/tmp/mything'] - - i.e. argument parsing is stopped at the first non-option argument. - """ - # do nothing - self._disable_interspersed_args = True - - def enable_interspersed_args(self): - """Set parsing to not stop on the first non-option. - - This it the default behaviour.""" - # do nothing - self._disable_interspersed_args = False - def find_file(self, name): """Locate a file located alongside the config files. |
