aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Dolbec <dolsen@gentoo.org>2016-07-05 22:22:25 -0700
committerBrian Dolbec <dolsen@gentoo.org>2016-07-08 08:35:38 -0700
commit3025811e5bbfd40a1a4e17ef5f305802cb545c22 (patch)
treefcd05c762dd3ee0b1e90afeef97005ede31a7719
parenteshowkw: remove unused portage.db import (diff)
downloadgentoolkit-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.py3
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"""