-
Notifications
You must be signed in to change notification settings - Fork 6
Fix command listing to show only main commands, hiding singular aliases #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Created a custom AliasedGroup class in /Users/ossama/dev/workato-platform-cli/src/workato_platform/cli/__init__.py:26-47 - Added add_command_with_alias() method that registers the command and stores alias mappings internally - Modified get_command() to resolve aliases to their main command names - Updated all command registrations to use add_command_with_alias() with the singular form as the hidden alias
check that alias is not equal to the main command name Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a custom AliasedGroup class to manage command aliases in the CLI, ensuring that only main commands appear in help output while singular forms remain accessible as hidden aliases. This eliminates duplicate command listings and centralizes alias management.
Key Changes:
- Introduced
AliasedGroupclass with internal alias mapping and resolution logic - Replaced duplicate
add_command()calls withadd_command_with_alias()method - Converted 8 plural-singular command pairs to use hidden aliases
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This PR implements a custom Click group class to manage command aliases, ensuring only main commands appear in help output while keeping singular forms accessible as hidden aliases. The solution centralizes alias management through a new AliasedGroup class that maps aliases to their main commands internally.
Key changes:
Introduced AliasedGroup class with internal alias mapping and resolution
Replaced duplicate command registrations with add_command_with_alias() calls
Converted all plural-singular command pairs to use hidden aliases