mirror of
https://github.com/ihabunek/toot.git
synced 2025-10-21 19:44:16 -04:00
Use kebab case for multi-word commands
But keep snake case as hidden alternatives so as not to break anything.
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import click
|
import click
|
||||||
import json as pyjson
|
import json as pyjson
|
||||||
|
|
||||||
|
from copy import copy
|
||||||
from typing import BinaryIO, Optional
|
from typing import BinaryIO, Optional
|
||||||
|
|
||||||
from toot import api
|
from toot import api
|
||||||
@@ -9,7 +10,7 @@ from toot.cli.validators import validate_language
|
|||||||
from toot.output import print_acct_list
|
from toot.output import print_acct_list
|
||||||
|
|
||||||
|
|
||||||
@cli.command(name="update_account")
|
@cli.command()
|
||||||
@click.option("--display-name", help="The display name to use for the profile.")
|
@click.option("--display-name", help="The display name to use for the profile.")
|
||||||
@click.option("--note", help="The account bio.")
|
@click.option("--note", help="The account bio.")
|
||||||
@click.option(
|
@click.option(
|
||||||
@@ -106,6 +107,12 @@ def update_account(
|
|||||||
click.secho("✓ Account updated", fg="green")
|
click.secho("✓ Account updated", fg="green")
|
||||||
|
|
||||||
|
|
||||||
|
# Make alias in snake case to keep BC
|
||||||
|
update_account_alias = copy(update_account)
|
||||||
|
update_account_alias.hidden = True
|
||||||
|
cli.add_command(update_account_alias, name="update_account")
|
||||||
|
|
||||||
|
|
||||||
@cli.command()
|
@cli.command()
|
||||||
@click.argument("account")
|
@click.argument("account")
|
||||||
@json_option
|
@json_option
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
from copy import copy
|
||||||
import click
|
import click
|
||||||
|
|
||||||
from toot import api
|
from toot import api
|
||||||
@@ -129,7 +130,7 @@ def unbookmark(ctx: Context, status_id: str, json: bool):
|
|||||||
click.secho("✓ Status unbookmarked", fg="green")
|
click.secho("✓ Status unbookmarked", fg="green")
|
||||||
|
|
||||||
|
|
||||||
@cli.command(name="reblogged_by")
|
@cli.command()
|
||||||
@click.argument("status_id")
|
@click.argument("status_id")
|
||||||
@json_option
|
@json_option
|
||||||
@pass_context
|
@pass_context
|
||||||
@@ -146,3 +147,9 @@ def reblogged_by(ctx: Context, status_id: str, json: bool):
|
|||||||
print_table(headers, rows)
|
print_table(headers, rows)
|
||||||
else:
|
else:
|
||||||
click.echo("This status is not reblogged by anyone")
|
click.echo("This status is not reblogged by anyone")
|
||||||
|
|
||||||
|
|
||||||
|
# Make alias in snake case to keep BC
|
||||||
|
reblogged_by_alias = copy(reblogged_by)
|
||||||
|
reblogged_by_alias.hidden = True
|
||||||
|
cli.add_command(reblogged_by_alias, name="reblogged_by")
|
||||||
|
|||||||
Reference in New Issue
Block a user