Skip to content

Allow hyphens in custom command names and aliases #7

Closed
@paduszyk

Description

@paduszyk

Description

Custom command names and aliases, defined via MANAGEMENT_COMMANDS_PATHS and MANAGEMENT_COMMANDS_ALIASES dictionaries, settings don't necessarily have to be Python identifiers as they don't refer to Python modules. Including hyphens imitating spaces would allow the creation of more human-readable names and aliases.

For example, instead of fullcheck, one could define full-check.

Suggested Solution

Command names/aliases are validated using a helper function:

def _is_identifier(s: str) -> bool:
return s.isidentifier() and not iskeyword(s)

It can be extended to return True for strings containing hyphens.

Terms

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions