From 3025811e5bbfd40a1a4e17ef5f305802cb545c22 Mon Sep 17 00:00:00 2001 From: Brian Dolbec Date: Tue, 5 Jul 2016 22:22:25 -0700 Subject: 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""" -- cgit v1.2.3