Fix Himalaya search by quoting query and placing it at end of command
The search query was being inserted unquoted in the middle of the command, but Himalaya CLI expects the query to be quoted and positioned at the end.
This commit is contained in:
@@ -339,11 +339,15 @@ async def search_envelopes(
|
||||
# Himalaya query syntax: from <pattern> or to <pattern> or subject <pattern> or body <pattern>
|
||||
search_query = f"from {query} or to {query} or subject {query} or body {query}"
|
||||
|
||||
cmd = f"himalaya envelope list -o json -s {limit} {search_query}"
|
||||
# Build command with options before the query (query must be at the end, quoted)
|
||||
cmd = "himalaya envelope list -o json"
|
||||
if folder:
|
||||
cmd += f" -f '{folder}'"
|
||||
if account:
|
||||
cmd += f" -a '{account}'"
|
||||
cmd += f" -s {limit}"
|
||||
# Query must be quoted and at the end of the command
|
||||
cmd += f' "{search_query}"'
|
||||
|
||||
process = await asyncio.create_subprocess_shell(
|
||||
cmd,
|
||||
|
||||
Reference in New Issue
Block a user