0
0
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:
Ivan Habunek
2025-10-14 15:54:00 +02:00
parent d235820b30
commit 24f6092a20
2 changed files with 16 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
import click
import json as pyjson
from copy import copy
from typing import BinaryIO, Optional
from toot import api
@@ -9,7 +10,7 @@ from toot.cli.validators import validate_language
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("--note", help="The account bio.")
@click.option(
@@ -106,6 +107,12 @@ def update_account(
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()
@click.argument("account")
@json_option

View File

@@ -1,3 +1,4 @@
from copy import copy
import click
from toot import api
@@ -129,7 +130,7 @@ def unbookmark(ctx: Context, status_id: str, json: bool):
click.secho("✓ Status unbookmarked", fg="green")
@cli.command(name="reblogged_by")
@cli.command()
@click.argument("status_id")
@json_option
@pass_context
@@ -146,3 +147,9 @@ def reblogged_by(ctx: Context, status_id: str, json: bool):
print_table(headers, rows)
else:
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")