mirror of
https://github.com/ihabunek/toot.git
synced 2025-02-02 15:07:51 -05:00
Improve visibility help string
This commit is contained in:
parent
aa75cacbff
commit
a3fa7e1e3a
@ -13,6 +13,7 @@ from toot.exceptions import ApiError, ConsoleError
|
|||||||
from toot.output import print_out, print_err
|
from toot.output import print_out, print_err
|
||||||
|
|
||||||
VISIBILITY_CHOICES = ['public', 'unlisted', 'private', 'direct']
|
VISIBILITY_CHOICES = ['public', 'unlisted', 'private', 'direct']
|
||||||
|
VISIBILITY_CHOICES_STR = ", ".join(f"'{v}'" for v in VISIBILITY_CHOICES)
|
||||||
|
|
||||||
|
|
||||||
def get_default_visibility():
|
def get_default_visibility():
|
||||||
@ -152,6 +153,15 @@ status_id_arg = (["status_id"], {
|
|||||||
"type": str,
|
"type": str,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
visibility_arg = (["-v", "--visibility"], {
|
||||||
|
"type": visibility,
|
||||||
|
"default": get_default_visibility(),
|
||||||
|
"help": f"Post visibility. One of: {VISIBILITY_CHOICES_STR}. Defaults to "
|
||||||
|
f"'{get_default_visibility()}' which can be overridden by setting "
|
||||||
|
"the TOOT_POST_VISIBILITY environment variable",
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
# Arguments for selecting a timeline (see `toot.commands.get_timeline_generator`)
|
# Arguments for selecting a timeline (see `toot.commands.get_timeline_generator`)
|
||||||
common_timeline_args = [
|
common_timeline_args = [
|
||||||
(["-p", "--public"], {
|
(["-p", "--public"], {
|
||||||
@ -350,11 +360,7 @@ POST_COMMANDS = [
|
|||||||
"help": "plain-text description of the media for accessibility "
|
"help": "plain-text description of the media for accessibility "
|
||||||
"purposes, one per attached media"
|
"purposes, one per attached media"
|
||||||
}),
|
}),
|
||||||
(["-v", "--visibility"], {
|
visibility_arg,
|
||||||
"type": visibility,
|
|
||||||
"default": get_default_visibility(),
|
|
||||||
"help": 'post visibility, one of: %s' % ", ".join(VISIBILITY_CHOICES),
|
|
||||||
}),
|
|
||||||
(["-s", "--sensitive"], {
|
(["-s", "--sensitive"], {
|
||||||
"action": 'store_true',
|
"action": 'store_true',
|
||||||
"default": False,
|
"default": False,
|
||||||
@ -438,12 +444,7 @@ STATUS_COMMANDS = [
|
|||||||
Command(
|
Command(
|
||||||
name="reblog",
|
name="reblog",
|
||||||
description="Reblog a status",
|
description="Reblog a status",
|
||||||
arguments=[status_id_arg,
|
arguments=[status_id_arg, visibility_arg],
|
||||||
(["-v", "--visibility"], {
|
|
||||||
"type": visibility,
|
|
||||||
"default": get_default_visibility(),
|
|
||||||
"help": 'boost visibility, one of: %s' % ", ".join(VISIBILITY_CHOICES),
|
|
||||||
})],
|
|
||||||
require_auth=True,
|
require_auth=True,
|
||||||
),
|
),
|
||||||
Command(
|
Command(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user