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

🐛 add builtin flags for cli pre-processing #1780

Merged
merged 1 commit into from
Sep 19, 2023
Merged

Conversation

arlimus
Copy link
Member

@arlimus arlimus commented Sep 19, 2023

This avoids an error-message which makes users think that recordings were not loaded.

Before

..go/src/go.mondoo.com/cnquery ±> go run apps/cnquery/cnquery.go run -c sshd.config.params --use-recording a.json
! pre-processing of cli had an error error="unknown flag: --use-recording"
→ no provider specified, defaulting to local. Use --help to see all providers.
→ loaded configuration from /home/zero/.config/mondoo/mondoo.yml using source default

After:

..go/src/go.mondoo.com/cnquery ±> go run apps/cnquery/cnquery.go run -c sshd.config.params --use-recording a.json
→ no provider specified, defaulting to local. Use --help to see all providers.
→ loaded configuration from /home/zero/.config/mondoo/mondoo.yml using source default

This avoids an error-message which makes users think that recordings were not loaded.

Signed-off-by: Dominik Richter <[email protected]>
Copy link
Member Author

Choose a reason for hiding this comment

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

Extracted flags to a separate file for easier discovery. However: We don't want to have any cobra/pflags dependencies in this part of the plugin sdk, so it is restricted to just the flags

ID: "go.mondoo.com/cnquery/providers/mock",
Name: "mock",
ID: "go.mondoo.com/cnquery/providers/mock",
Version: "9.0.0",
Copy link
Member Author

Choose a reason for hiding this comment

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

without this it shows without version in cnquery providers

Copy link
Member

@chris-rock chris-rock left a comment

Choose a reason for hiding this comment

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

Thank you @arlimus

@chris-rock chris-rock merged commit 846c110 into main Sep 19, 2023
10 checks passed
@chris-rock chris-rock deleted the dom/cli-root-warnings branch September 19, 2023 09:49
@github-actions github-actions bot locked and limited conversation to collaborators Sep 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants