diff --git a/natto/option_parse.py b/natto/option_parse.py index b25007c..2f40157 100644 --- a/natto/option_parse.py +++ b/natto/option_parse.py @@ -76,7 +76,7 @@ def error(self, message): if type(options) is dict: for name in iter(list(self._SUPPORTED_OPTS.values())): if name in options: - if options[name]: + if options[name] or options[name] is '': val = options[name] if isinstance(val, bytes): val = self.__bytes2str(options[name]) @@ -148,12 +148,12 @@ def error(self, message): help='set cost factor (default 700)', action='store', dest='cost_factor', type=int) - opts = p.parse_args(options.split()) + opts = p.parse_args([o.replace('\"', '').replace('\'', '') for o in options.split()]) for name in iter(list(self._SUPPORTED_OPTS.values())): if hasattr(opts, name): v = getattr(opts, name) - if v: + if v or v is '': dopts[name] = v # final checks