Classes
BengalCommand
Custom Click command with themed help output.
BengalCommand
Custom Click command with themed help output.
Inherits from
click.CommandMethods 1
format_help
Format help output using our themed CLIOutput.
format_help
def format_help(self, ctx: click.Context, formatter: click.HelpFormatter) -> None
Format help output using our themed CLIOutput.
Parameters 2
ctx |
click.Context |
|
formatter |
click.HelpFormatter |
BengalGroup
Custom Click group with typo detection and themed help output.
BengalGroup
Custom Click group with typo detection and themed help output.
Inherits from
click.GroupMethods 2
format_help
Format help output using our themed CLIOutput.
format_help
def format_help(self, ctx: click.Context, formatter: click.HelpFormatter) -> None
Format help output using our themed CLIOutput.
Parameters 2
ctx |
click.Context |
|
formatter |
click.HelpFormatter |
resolve_command
Resolve command with fuzzy matching for typos.
resolve_command
def resolve_command(self, ctx: click.Context, args: list[str]) -> tuple[str | None, click.Command | None, list[str]]
Resolve command with fuzzy matching for typos.
Parameters 2
ctx |
click.Context |
|
args |
list[str] |
Returns
tuple[str | None, click.Command | None, list[str]]
Internal Methods 1
_get_similar_commands
Find similar command names using simple string similarity.
_get_similar_commands
def _get_similar_commands(self, unknown_cmd: str, max_suggestions: int = 3) -> list[str]
Find similar command names using simple string similarity.
Parameters 2
unknown_cmd |
str |
|
max_suggestions |
int |
Returns
list[str]
Functions
get_aliases_for_command
Get all aliases for a canonical command name.
get_aliases_for_command
def get_aliases_for_command(cmd_name: str) -> list[str]
Get all aliases for a canonical command name.
Parameters 1
| Name | Type | Default | Description |
|---|---|---|---|
cmd_name |
str |
— |
Returns
list[str]
get_canonical_name
Get the canonical command name for an alias (or return as-is if not an alias).
get_canonical_name
def get_canonical_name(cmd_or_alias: str) -> str
Get the canonical command name for an alias (or return as-is if not an alias).
Parameters 1
| Name | Type | Default | Description |
|---|---|---|---|
cmd_or_alias |
str |
— |
Returns
str
_sanitize_help_text
Remove Commands section from help text to avoid duplication.
Click automatically generates a Comma…
_sanitize_help_text
def _sanitize_help_text(text: str) -> str
Remove Commands section from help text to avoid duplication.
Click automatically generates a Commands section, so we remove it from the docstring to avoid showing it twice.
Parameters 1
| Name | Type | Default | Description |
|---|---|---|---|
text |
str |
— |
Returns
str