Skip to content
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

introduce CLI command categories to improve help display #9210

Merged
merged 1 commit into from Sep 25, 2023

Conversation

thrau
Copy link
Member

@thrau thrau commented Sep 22, 2023

Motivation

As the number of CLI commands increases, it becomes harder to separate basic from advanced functionality that is part of our paid offering. This PR introduces the notion of command categories into our localstack command group, that allow us to visually separate the commands.

image

The current implementation is very rudimentary, with grouping commands manually with a list of commands. I know this is not great, but it's the easiest way to get started without having to introduce additional concepts in ext for now.

Changes

  • Rename the ExceptionCmdHandler to a more generic LocalStackCliGroup
  • Overwrite the format_commands method of click.Group with our own implementation that adds categories

@coveralls
Copy link

Coverage Status

coverage: 82.951% (+0.01%) from 82.94% when pulling 7efc2a6 on cli-command-categories into 4d3a8b1 on master.

@github-actions
Copy link

LocalStack Community integration with Pro

       2 files         2 suites   1h 18m 0s ⏱️
2 217 tests 1 721 ✔️ 496 💤 0
2 218 runs  1 721 ✔️ 497 💤 0

Results for commit 7efc2a6.

@thrau thrau added this to the 2.3 milestone Sep 22, 2023
@thrau thrau added the semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases label Sep 22, 2023
Copy link
Contributor

@SimonWallner SimonWallner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀

I'm leaning a bit towards a 'running localstack' section with [start, stop, logs, ssh, wait] but we are facing diminishing returns quickly if we have too many sections as already discussed. so happy with it how it is rn.

This change is a good starting point and we should revisit it whenever we add/remove commands. people aint gonna interact with the help every day, so changing it more often, whenever the need arises should not be a issue.

Copy link
Member

@alexrashed alexrashed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a nice first iteration. I agree that it would be nice to have a way to mark a command as "advanced", but we can look into this once this format has settled. 🚀

@thrau thrau merged commit 1251fef into master Sep 25, 2023
28 of 29 checks passed
@thrau thrau deleted the cli-command-categories branch September 25, 2023 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants