diff options
author | Jan Pokorný <jpokorny@redhat.com> | 2015-02-19 21:56:57 +0100 |
---|---|---|
committer | Jan Pokorný <jpokorny@redhat.com> | 2015-02-26 22:37:53 +0100 |
commit | f38cb2b44f030f711b6b6da6d2b1615a82cb3e5d (patch) | |
tree | e8759fd31806e33bfe18e802bbfe0f1aeb4c630e /ext-plugins | |
parent | 12dffe7c533ac9b595e80e376877fbd1cb79fb2c (diff) | |
download | clufter-f38cb2b44f030f711b6b6da6d2b1615a82cb3e5d.tar.gz clufter-f38cb2b44f030f711b6b6da6d2b1615a82cb3e5d.tar.xz clufter-f38cb2b44f030f711b6b6da6d2b1615a82cb3e5d.zip |
lib-general/formats/command: fix __cmd__/__args__ bad handling
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Diffstat (limited to 'ext-plugins')
-rw-r--r-- | ext-plugins/lib-general/formats/command.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ext-plugins/lib-general/formats/command.py b/ext-plugins/lib-general/formats/command.py index 65145b9..06e5bce 100644 --- a/ext-plugins/lib-general/formats/command.py +++ b/ext-plugins/lib-general/formats/command.py @@ -82,8 +82,9 @@ class command(SimpleFormat): arg_bucket = '__cmd__' while separated: head, tail = head_tail(separated.pop()) - head = head if head.startswith('-') and head != '-' else arg_bucket - arg_bucket = arg_bucket if not head.startswith('-') else '__args__' - acc = ret.setdefault(head, []) - acc.append(tail) + if head.startswith('-') and head != '-': + arg_bucket = '__args__' + else: + head, tail = arg_bucket, head + ret.setdefault(head, []).append(tail) return ret |