Improving CLI Help Documentation for Complex Options #8304
knqyf263
started this conversation in
Development
Replies: 1 comment
-
My thoughts:
But if we want to make additional command for each subcommand/flag - I would prefer to use point 4 and the created pages in docs + update the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description:
Currently, Trivy displays CLI flag help information in a single-line format via
--help
. While this works for simple options, it becomes problematic for flags with multiple possible values or extensive configuration options.Background
We've encountered several cases where the current help format is insufficient:
--severity-src
flag has numerous possible sources, making the help text lengthy and hard to read (feat: add--severity-src
flag #8269 (comment))These lists are frequently updated, so any solution should support automated generation.
Proposed Solutions
1. Help Topics
Similar to Go's help command, which provides both command and topic-based help:
The Go command also provides detailed help for specific options:
We could implement a similar UI in Trivy:
Pros
Cons
PoC
Details
2. Single-line Format (Current Style)
Continue with the current format and include all options:
Pros:
Cons:
3. Multi-line Format
Format complex options across multiple lines, similar to AWS CLI:
Pros:
--help
Cons:
4. Auto-generated Documentation
Extend our current documentation generation (
mage docs:generate
) to include these lists.Pros:
Cons:
Questions for Discussion
@aquasecurity/trivy I would discuss the best path forward for improving our CLI help documentation.
Beta Was this translation helpful? Give feedback.
All reactions