Skip to content

CLI: Register commands in a different place from where the command list is instantiated #9635

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

Merged
merged 2 commits into from
Jun 16, 2025

Conversation

tempoz
Copy link
Contributor

@tempoz tempoz commented Jun 11, 2025

The parser needs to have access to the full list of CLI commands, and many packages use or may need to use the parser. To avoid dependency cycles, we declare the list in one package and populate using the Register function in a sub-package. We call register.Register as one of our first calls upon beginning execution.

tempoz added 2 commits June 11, 2025 15:57
this lets us avoid dependency cycles, since many things may depend on
the contents of this list
@tempoz tempoz requested a review from bduffany June 11, 2025 20:24
@tempoz tempoz merged commit 6cdd5ab into master Jun 16, 2025
13 checks passed
@tempoz tempoz deleted the register-cli-commands branch June 16, 2025 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants