You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using golang's built-in flags package interacts poorly with Cobra when providing --help on the command.
We can fix this by using Cobra's native flags (pflags) but the associated refactor isn't a clear positive code-wise. Not a high priority but worth noting this drawback.
Details
go run ./tools/ctl provides the "good" Cobra-based help:
$ go run ./tools/ctl
A debugging tool for OSS-Rebuild
Usage:
ctl [command]
Available Commands:
completion Generate the autocompletion script for the specified shell
get-results Analyze rebuild results
help Help about any command
list-runs List runs
run-bench Run benchmark
run-one Run benchmark
tui A terminal UI for the OSS-Rebuild debugging tools
Flags:
-h, --help help for ctl
Use "ctl [command] --help" for more information about a command.
...but go run ./tools/ctl --help shows the flat native flag help:
$ go run ./tools/ctl --help
Usage of /tmp/go-build999803442/b001/exe/ctl:
-api string
OSS Rebuild API endpoint URI
-artifact string
the artifact name
-bench string
a path to a benchmark file. if provided, only results from that benchmark will be fetched
-benchmark-dir string
a directory with benchmarks to work with
-clean
whether to apply normalization heuristics to group similar verdicts
....
The usage of the flag values would need to be mediated by either global variables (as flag definitions currently are) or built into cmd-specific data types passed in to the cmd defintions.
The text was updated successfully, but these errors were encountered:
Using golang's built-in flags package interacts poorly with Cobra when providing
--help
on the command.We can fix this by using Cobra's native flags (pflags) but the associated refactor isn't a clear positive code-wise. Not a high priority but worth noting this drawback.
Details
go run ./tools/ctl
provides the "good" Cobra-based help:...but
go run ./tools/ctl --help
shows the flat native flag help:Fix
The usage of the flag values would need to be mediated by either global variables (as flag definitions currently are) or built into cmd-specific data types passed in to the cmd defintions.
The text was updated successfully, but these errors were encountered: