Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: cleaner error messages for
config set
(#4549)
- closes #4545 ``` bacalhau config set api.port=12.3.3.3 14:44:15.82 | INF cmd/cli/config/set.go:94 > Writing config to /home/frrist/.bacalhau/config.yaml Error: config key: "api.port" expects an integer value, received: "12.3.3.3" Hint: Accepted formats: '1', '2', '10', etc. ``` ``` bacalhau config set orchestrator.evaluationbroker.visibilitytimeout 1 14:44:49.301 | INF cmd/cli/config/set.go:94 > Writing config to /home/frrist/.bacalhau/config.yaml Error: config key: "orchestrator.evaluationbroker.visibilitytimeout" expects a valid duration value, received: "1" Hint: Accepted formats: 'h' (hours), 'm' (minutes), 's' (seconds), 'ms' (milliseconds), etc. Example: '2h45m', '30s', '100ms ``` ``` bacalhau config set compute.labels city=portugal,dish=Pastel-de-Nata,food 14:45:03.796 | INF cmd/cli/config/set.go:94 > Writing config to /home/frrist/.bacalhau/config.yaml Error: invalid format [city=portugal dish=Pastel-de-Nata food]: expected 'key=value', but found no '=' in 'food' Hint: Accepted formats: 'key=value', 'key1=value1,key2=value2', etc. ``` ``` bacalhau config set compute.labels city=portugal,dish=Pastel-de-Nata,food==value 14:45:21.741 | INF cmd/cli/config/set.go:94 > Writing config to /home/frrist/.bacalhau/config.yaml Error: invalid format [city=portugal dish=Pastel-de-Nata food==value]: found multiple '=' in 'food==value'. Only one '=' is allowed per key-value pair Hint: Accepted formats: 'key=value', 'key1=value1,key2=value2', etc. ``` --------- Co-authored-by: frrist <[email protected]> Co-authored-by: Walid Baruni <[email protected]>
- Loading branch information