Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When passing empty -v in set goml does not return an error #8

Open
andrew-edgar opened this issue Jul 3, 2020 · 1 comment
Open

Comments

@andrew-edgar
Copy link

If using goml set and the value is not specified the incorrect usage is shown but the return code is 0 which causes scripts to not exit.

Can all incorrect usage messages produce a non 0 error?

coligo goml set -f eprops-test/properties.yml -p "template.version" -v
Incorrect Usage: flag needs an argument: -v
NAME:
   goml set - Set/Update property
USAGE:
   goml set [command options] [arguments...]
OPTIONS:
   --file value, -f value   path to YAML file
   --prop value, -p value   property path string - foo.bar.zoo
   --value value, -v value  value for the defined property
   --key value, -k value    private key file
   --dry-run, -d            print set result to stdout
   --json, -j               format output as json
➜  coligo echo $?
0
@andrew-edgar
Copy link
Author

I think you just need to check the error in cmd.Run() …

https://github.com/herrjulz/goml/blob/master/cmd/goml/main.go#L78

Should look more like this …

	err := cmd.Run(os.Args)
	if err != nil {
		log.Fatal(err)
	}

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

No branches or pull requests

1 participant