Print statuses in search output

This commit is contained in:
Ivan Habunek 2024-08-12 12:04:29 +02:00
parent 070f6b9ef1
commit a730a33901
No known key found for this signature in database
GPG Key ID: 01DB3DD0D824504C
1 changed files with 9 additions and 3 deletions

View File

@ -159,8 +159,9 @@ def print_list_accounts(accounts):
def print_search_results(results):
accounts = results["accounts"]
hashtags = results["hashtags"]
accounts = results.get("accounts")
hashtags = results.get("hashtags")
statuses = results.get("statuses")
if accounts:
click.echo("\nAccounts:")
@ -170,7 +171,12 @@ def print_search_results(results):
click.echo("\nHashtags:")
click.echo(", ".join([format_tag_name(tag) for tag in hashtags]))
if not accounts and not hashtags:
if statuses:
click.echo("\nStatuses:")
for status in statuses:
click.echo(f" * {green(status['id'])} {status['url']}")
if not accounts and not hashtags and not statuses:
click.echo("Nothing found")