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

Simplify flag setup using early platform configuration #1877

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

skitt
Copy link
Contributor

@skitt skitt commented Jan 14, 2025

See individual commits for details.

skitt added 2 commits January 14, 2025 14:01
config.GetPlatform handles command-line flags etc., using it ensures
that user settings are handled consistently. There's no need to
duplicate flag-handling in the system subcommand.

Signed-off-by: Stephen Kitt <[email protected]>
Since config.GetPlatform is usable during application initialisation
(it doesn't rely on cobra), it can be called to determine the platform
during cobra setup. Thus platform-specific flags can be declared only
if the selected platform is relevant, instead of hiding them after
declaring them.

Signed-off-by: Stephen Kitt <[email protected]>
@skitt skitt force-pushed the early-platform-setup branch from 829893d to 2076b44 Compare January 14, 2025 13:01
Copy link
Member

@fgiorgetti fgiorgetti left a comment

Choose a reason for hiding this comment

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

LGTM

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