scripts: Fixed missing tuple unpack in glob-all CLI attrs

This was broken:

  $ ./scripts/plotmpl.py -L'*=bs=%(bs)s'

There may be a better way to organize this logic, but spamming if
statements works well enough.
This commit is contained in:
Christopher Haster
2025-05-15 13:47:09 -05:00
parent a3710d1d96
commit 48c1a016a0
9 changed files with 27 additions and 18 deletions

View File

@@ -308,9 +308,10 @@ class Attr:
self.attrs = []
self.keyed = co.OrderedDict()
for attr in attrs:
if (not isinstance(attr, tuple)
or attr[0] in {None, (), (None,), ('*',)}):
if not isinstance(attr, tuple):
attr = ((), attr)
if attr[0] in {None, (), (None,), ('*',)}:
attr = ((), attr[1])
if not isinstance(attr[0], tuple):
attr = ((attr[0],), attr[1])