From 406943237a7058b51b7932fa81d184c2f0d552d9 Mon Sep 17 00:00:00 2001 From: kakakaya Date: Tue, 6 Mar 2018 03:13:45 +0900 Subject: [PATCH] Support -l/--local argument in timeline command --- toot/commands.py | 5 ++++- toot/console.py | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/toot/commands.py b/toot/commands.py index 6a98a0d..16b44a3 100644 --- a/toot/commands.py +++ b/toot/commands.py @@ -8,7 +8,10 @@ from toot.utils import assert_domain_exists def timeline(app, user, args): - items = api.timeline_home(app, user) + if args.local: + items = api.timeline_public(app, user, local=True) + else: + items = api.timeline_home(app, user) print_timeline(items) diff --git a/toot/console.py b/toot/console.py index 8613775..80d3a45 100644 --- a/toot/console.py +++ b/toot/console.py @@ -132,7 +132,13 @@ READ_COMMANDS = [ Command( name="timeline", description="Show recent items in your public timeline", - arguments=[], + arguments=[ + (["-l", "--local"], { + "action": 'store_true', + "default": False, + "help": "Show local timeline instead of public timeline.", + }), + ], require_auth=True, ), Command(