Skip to content

Commit

Permalink
Run curses with 20 statuses per page by default
Browse files Browse the repository at this point in the history
  • Loading branch information
ihabunek committed Apr 23, 2019
1 parent 912e7c8 commit c862df8
Showing 1 changed file with 23 additions and 14 deletions.
37 changes: 23 additions & 14 deletions toot/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def timeline_count(value):
})

# Arguments for selecting a timeline (see `toot.commands.get_timeline_generator`)
timeline_args = [
common_timeline_args = [
(["-p", "--public"], {
"action": "store_true",
"default": False,
Expand All @@ -108,13 +108,33 @@ def timeline_count(value):
"type": int,
"help": "show timeline for given list.",
}),
]

timeline_args = common_timeline_args + [
(["-c", "--count"], {
"type": timeline_count,
"help": "number of toots to show per page (1-20, default 10).",
"default": 10,
}),
(["-r", "--reverse"], {
"action": "store_true",
"default": False,
"help": "Reverse the order of the shown timeline (to new posts at the bottom)",
}),
(["-1", "--once"], {
"action": "store_true",
"default": False,
"help": "Only show the first <count> toots, do not prompt to continue.",
}),
]

curses_args = common_timeline_args + [
(["-c", "--count"], {
"type": timeline_count,
"help": "number of toots to show per page (1-20, default 20).",
"default": 20,
}),
]

AUTH_COMMANDS = [
Command(
Expand Down Expand Up @@ -219,24 +239,13 @@ def timeline_count(value):
Command(
name="timeline",
description="Show recent items in a timeline (home by default)",
arguments=timeline_args + [
(["-r", "--reverse"], {
"action": "store_true",
"default": False,
"help": "Reverse the order of the shown timeline (to new posts at the bottom)",
}),
(["-1", "--once"], {
"action": "store_true",
"default": False,
"help": "Only show the first <count> toots, do not prompt to continue.",
}),
],
arguments=timeline_args,
require_auth=True,
),
Command(
name="curses",
description="An experimental timeline app (doesn't work on Windows)",
arguments=timeline_args,
arguments=curses_args,
require_auth=False,
),
]
Expand Down

0 comments on commit c862df8

Please sign in to comment.