@@ 445,7 445,13 @@ class Barszcz:
if query:
# Query could be blank/empty
summary_lines[0] += " matched by query:"
- summary_lines.append(query)
+ if isinstance(query, str):
+ summary_lines.append(query)
+ elif isinstance(query, list):
+ # A query list of length one is used by the `more` command for
+ # `AttributeThings`. In this case, print the list minus the
+ # square brackets.
+ summary_lines.append(str(query)[1:-1])
summary = HeadingThing(summary_lines)
things = [summary] + album_things + item_things
@@ 481,7 487,10 @@ class Barszcz:
*self.group_dimensions,
)
elif isinstance(thing, AttributeThing):
- return self.ls(f"{thing.key}:{thing.value}")
+ # Use a list query to ensure the value is associated with the key
+ # (not any other fields), and to avoid problems with escaping of
+ # quote marks.
+ return self.ls([f"{thing.key}:{thing.value}"])
def do_command(self, command):
""""Attempts to parse a command string and execute it.