From 24f6092a20dd263db054c33d36eac37e5a65eff7 Mon Sep 17 00:00:00 2001 From: Ivan Habunek Date: Tue, 14 Oct 2025 15:54:00 +0200 Subject: [PATCH] Use kebab case for multi-word commands But keep snake case as hidden alternatives so as not to break anything. --- toot/cli/accounts.py | 9 ++++++++- toot/cli/statuses.py | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/toot/cli/accounts.py b/toot/cli/accounts.py index 01c499d..8786e24 100644 --- a/toot/cli/accounts.py +++ b/toot/cli/accounts.py @@ -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 diff --git a/toot/cli/statuses.py b/toot/cli/statuses.py index 0d088b2..9d6315e 100644 --- a/toot/cli/statuses.py +++ b/toot/cli/statuses.py @@ -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")