Skip to content

Conversation

@pstibrany
Copy link
Contributor

What this PR does / why we need it:

-h/-help now prints available parameters and their descriptions to stdout. This makes it easier to grep/less them without extra stderr->stdout redirects.

When invalid parameter or value is provided, error is printed to stderr, together with message indicating how to get list of all parameters. For example:

flag provided but not defined: -helpasdjh
Run with -help to get list of available parameters

or

invalid value "12837128937p" for flag -validation.reject-old-samples.max-age: parse error
Run with -help to get list of available parameters

Which issue(s) this PR fixes:
Fixes #1193

When invalid parameter or value is provided, error is printed to stderr,
together with message indicating how to get list of all parameters.

Signed-off-by: Peter Štibraný <[email protected]>
Copy link
Contributor

@cyriltovena cyriltovena left a comment

Choose a reason for hiding this comment

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

Lgtm

@cyriltovena cyriltovena merged commit 3aff4df into grafana:master Dec 13, 2019
@pstibrany pstibrany deleted the help-stdout branch December 13, 2019 14:25
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.

Send --help output to stdout

2 participants