diff options
author | Brian Dolbec <dolsen@gentoo.org> | 2016-07-05 22:22:25 -0700 |
---|---|---|
committer | Brian Dolbec <dolsen@gentoo.org> | 2016-07-08 08:35:38 -0700 |
commit | 3025811e5bbfd40a1a4e17ef5f305802cb545c22 (patch) | |
tree | fcd05c762dd3ee0b1e90afeef97005ede31a7719 | |
parent | eshowkw: remove unused portage.db import (diff) | |
download | gentoolkit-3025811e5bbfd40a1a4e17ef5f305802cb545c22.tar.gz gentoolkit-3025811e5bbfd40a1a4e17ef5f305802cb545c22.tar.bz2 gentoolkit-3025811e5bbfd40a1a4e17ef5f305802cb545c22.zip |
module_base.py: Add a char type cli option capability
This adds correct handling of the value being assigned to the class options.
-rw-r--r-- | pym/gentoolkit/module_base.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pym/gentoolkit/module_base.py b/pym/gentoolkit/module_base.py index 87e04f1..5182218 100644 --- a/pym/gentoolkit/module_base.py +++ b/pym/gentoolkit/module_base.py @@ -67,7 +67,6 @@ class ModuleBase(object): def parse_module_options(self, module_opts): """Parse module options and update self.options""" - opts = (x[0] for x in module_opts) posargs = (x[1] for x in module_opts) for opt, posarg in zip(opts, posargs): @@ -88,6 +87,8 @@ class ModuleBase(object): self.print_help(with_description=False) sys.exit(2) self.options[opt_name] = val + elif opt_type == 'char': + self.options[opt_name] = posarg def set_quiet(self, quiet): """sets the class option["quiet"] and option["verbose"] accordingly""" |