commit:     3025811e5bbfd40a1a4e17ef5f305802cb545c22
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Jul  6 05:22:25 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Fri Jul  8 15:35:38 2016 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=3025811e

module_base.py: Add a char type cli option capability

This adds correct handling of the value being assigned to the class options.

 pym/gentoolkit/module_base.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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"""

Reply via email to