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

--help flag parsing #3393

Merged
merged 2 commits into from
Aug 16, 2023
Merged

--help flag parsing #3393

merged 2 commits into from
Aug 16, 2023

Conversation

geyslan
Copy link
Member

@geyslan geyslan commented Aug 16, 2023

Close: #3372

1. Explain what the PR does

0611b6d chore(cmd): refactor config flag
add4054 fix(cmd): --help flag parsing

fix(cmd): --help flag parsing

The --help flag was not being parsed correctly, i.e.
`sudo ./dist/tracee --help whatever` was not showing the help message.

This commit fixes the issue by using the `--help` flag as a boolean flag
and leaving the hard work to cobra.

2. Explain how to test it

sudo ./dist/tracee --help
sudo ./dist/tracee --help --scope comm=who
sudo ./dist/tracee --scope comm=who --help

Expected failing:

sudo ./dist/tracee --scope --help
sudo ./dist/tracee --help whatever

3. Other comments

@geyslan geyslan self-assigned this Aug 16, 2023
The --help flag was not being parsed correctly, i.e.
`sudo ./dist/tracee --help whatever` was not showing the help message.

This commit fixes the issue by using the `--help` flag as a boolean flag
and leaving the hard work to cobra.
@geyslan geyslan changed the title fix(cmd): --help flag parsing --help flag parsing Aug 16, 2023
@geyslan geyslan merged commit c568e05 into aquasecurity:main Aug 16, 2023
26 checks passed
@geyslan geyslan deleted the 3372-help-flag branch September 18, 2023 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

--help flag with value is being ignored
2 participants