From 3829a579094ba2501da6eceefbe92a88b7c173f1 Mon Sep 17 00:00:00 2001 From: Ivan Habunek Date: Mon, 11 May 2020 13:49:00 +0200 Subject: [PATCH] Add --reverse option to notifications fixes #151 --- CHANGELOG.md | 1 + changelog.yaml | 1 + toot/commands.py | 3 +++ toot/console.py | 5 +++++ 4 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75ca184..22f8614 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ Changelog * Fix access to public and tag timelines when on private mastodon instances (#168) +* Add `--reverse` option to `toot notifications` (#151) * TUI: Add opton to pin/save tag timelines (#163, thanks @dlax) **0.26.0 (2020-04-15)** diff --git a/changelog.yaml b/changelog.yaml index d035738..052e171 100644 --- a/changelog.yaml +++ b/changelog.yaml @@ -2,6 +2,7 @@ date: "TBD" changes: - "Fix access to public and tag timelines when on private mastodon instances (#168)" + - "Add `--reverse` option to `toot notifications` (#151)" - "TUI: Add opton to pin/save tag timelines (#163, thanks @dlax)" 0.26.0: diff --git a/toot/commands.py b/toot/commands.py index ac8d1ce..d92bc02 100644 --- a/toot/commands.py +++ b/toot/commands.py @@ -321,6 +321,9 @@ def notifications(app, user, args): print_out("No notification") return + if args.reverse: + notifications = reversed(notifications) + print_notifications(notifications) diff --git a/toot/console.py b/toot/console.py index b39002a..2ebc397 100644 --- a/toot/console.py +++ b/toot/console.py @@ -238,6 +238,11 @@ READ_COMMANDS = [ "action": 'store_true', "default": False, }), + (["-r", "--reverse"], { + "action": "store_true", + "default": False, + "help": "Reverse the order of the shown notifications (newest on top)", + }), ], require_auth=True, ),