mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-25 13:44:05 -08:00
Provide better errors messages in commandline
Instead or only printing the help message, which is not always helpful. For example, when upgrading from prometheus v1, the retention time value format has changed and now only accepts one unit (e.g. "15d") where it previously allowed more complex strings (e.g. "360h0m0s"). This commit provides the error message as an explanation for the parsing failure.
This commit is contained in:
parent
37ec2d5283
commit
38afa507bb
|
@ -175,6 +175,7 @@ func main() {
|
|||
|
||||
_, err := a.Parse(os.Args[1:])
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, errors.Wrapf(err, "Error parsing commandline arguments"))
|
||||
a.Usage(os.Args[1:])
|
||||
os.Exit(2)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue