Skip to content
Snippets Groups Projects
Unverified Commit 3b7bd7ac authored by Jon Crall's avatar Jon Crall
Browse files

Allow special options to be passed to cli

parent 7fd2fec2
No related branches found
No related tags found
1 merge request!32Start branch for dev/0.7.15
Pipeline #399010 passed
......@@ -6,6 +6,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
## Version 0.7.15 - Unreleased
### Added
* Allow special options to be passed to cli
## Version 0.7.14 - Released 2024-04-15
......
......@@ -341,7 +341,7 @@ class Config(ub.NiceRepr, DictLike, metaclass=MetaConfig):
@classmethod
def cli(cls, data=None, default=None, argv=None, strict=True,
cmdline=True, autocomplete='auto'):
cmdline=True, autocomplete='auto', special_options=True):
"""
Create a commandline aware config instance.
......@@ -390,7 +390,7 @@ class Config(ub.NiceRepr, DictLike, metaclass=MetaConfig):
# prevents adding clean options for control flow.
self = cls(_dont_call_post_init=True)
self.load(data, cmdline=cmdline, default=default, strict=strict,
autocomplete=autocomplete)
autocomplete=autocomplete, special_options=special_options)
return self
@classmethod
......@@ -564,7 +564,8 @@ class Config(ub.NiceRepr, DictLike, metaclass=MetaConfig):
self._alias_map = None
def load(self, data=None, cmdline=False, mode=None, default=None,
strict=False, autocomplete=False, _dont_call_post_init=False):
strict=False, autocomplete=False, _dont_call_post_init=False,
special_options=True):
"""
Updates the configuration from a given data source.
......@@ -738,7 +739,7 @@ class Config(ub.NiceRepr, DictLike, metaclass=MetaConfig):
# should override them IF they exist on in sys.argv, but not if
# they don't?
read_argv_kwargs = {
'special_options': True,
'special_options': special_options,
'strict': strict,
'autocomplete': autocomplete,
'argv': None,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment