Replace click.MultiCommand with click.Group #2096
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Migrates the CLI from the deprecated
click.MultiCommandtoclick.Group.click.MultiCommandwill be removed in click 9, so this change prepares the codebase for future click upgrades.Changes:
ElementaryCLIbase class fromclick.MultiCommandtoclick.Group@click.commandwith@click.groupdecorator_CMD_MAPdictionary andlist_commands()method (now handled byclick.Groupinternally)cli.add_command()instead of dictionary lookupget_command()to delegate tosuper().get_command()while preserving theauto_envvar_prefixsettingReview & Testing Checklist for Human
edr monitor --help,edr report --help,edr send-report --help,edr run-operation --helpedr --helpshows all 4 commands correctlyEDR_*environment variables are recognized)Recommended test plan: Install the package locally (
pip install -e .) and runedr --helpto verify the command list appears correctly, then test at least one subcommand end-to-end.Notes
Fixes ELE-5220
Link to Devin run: https://app.devin.ai/sessions/68de447c968446cc850dc87532c97ffe
Requested by: Itamar Hartstein (@haritamar)
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.