diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-02-20 07:57:22 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-02-20 07:57:22 +0100 |
commit | 3b4eddaf0a3421153be12735d19030604952fd7f (patch) | |
tree | 59fc22155b258008a395026a498cd4b50616a1c2 /src | |
parent | python version (too be documented and implemented in other versions): standard_abbreviations: if all expansions are synonyms, accept it; the standa... (diff) | |
download | argparser-3b4eddaf0a3421153be12735d19030604952fd7f.tar.gz argparser-3b4eddaf0a3421153be12735d19030604952fd7f.tar.bz2 argparser-3b4eddaf0a3421153be12735d19030604952fd7f.tar.xz |
m
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | src/argparser.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/argparser.py b/src/argparser.py index 92fe798..f9160da 100644 --- a/src/argparser.py +++ b/src/argparser.py @@ -86,7 +86,7 @@ class ArgParser(): ''' Gets the standard abbrevation expender - @return :(opt:str, opts:list<str>, mapping:dict<str, str>?=None)→str? The standard abbrevation expender + @return :(opt:str, opts:list<str>, mapping:dict<str, str>)→str? The standard abbrevation expender ''' def uniq(items): if len(items) < 2: @@ -99,9 +99,9 @@ class ArgParser(): return rc one = lambda arg : arg[0] if len(arg) == 1 else None lfilter = lambda f, l : list(filter(f, l)) - map_ = lambda mapping, args : args if mapping is None else [mapping[a] for a in args] + map_ = lambda mapping, args : [mapping[a] for a in args] test = lambda arg : lambda a : a.startswith(arg) - return lambda arg, candidates, mapping = None : one(uniq(map_(mapping, lfilter(test(arg), candidates)))) + return lambda arg, candidates, mapping : one(uniq(map_(mapping, lfilter(test(arg), candidates)))) @staticmethod |