diff options
| author | Mark McLoughlin <markmc@redhat.com> | 2012-11-12 16:25:59 -0500 |
|---|---|---|
| committer | Mark McLoughlin <markmc@redhat.com> | 2012-11-15 15:01:14 -0500 |
| commit | 5b9cb4148c2c16c910cb7eae9e7875a9fc06d3da (patch) | |
| tree | 5ec357d1099d30148605d40be449eedd91479be6 /openstack/common/plugin/callbackplugin.py | |
| parent | dbc72a6ef9a784c1bf5820a9750061d76529d571 (diff) | |
| download | oslo-5b9cb4148c2c16c910cb7eae9e7875a9fc06d3da.tar.gz oslo-5b9cb4148c2c16c910cb7eae9e7875a9fc06d3da.tar.xz oslo-5b9cb4148c2c16c910cb7eae9e7875a9fc06d3da.zip | |
Add support for positional arguments
argparse makes it awkward to implement the current cfg API where we
simply return the leftover arguments to the caller.
Very few cfg users actually rely on this functionality and for those
cases it probably makes more sense for them to explicitly register
positional arguments or sub-parsers.
Add support for positional arguments via a 'required' Opt attribute:
opt = StrOpt('foo', positional=True)
conf.register_cli_opt(opt)
conf(['bar'])
conf.foo == 'bar'
Change-Id: Iea746d710237e1ea26c1ef4871643941d1df09bd
Diffstat (limited to 'openstack/common/plugin/callbackplugin.py')
0 files changed, 0 insertions, 0 deletions
