Skip to content
This repository has been archived by the owner on Sep 28, 2021. It is now read-only.

Display error when passing invalid flags #390

Open
carlioth opened this issue Aug 30, 2019 · 2 comments
Open

Display error when passing invalid flags #390

carlioth opened this issue Aug 30, 2019 · 2 comments
Labels
bug Something isn't working v2

Comments

@carlioth
Copy link
Contributor

If I pass an invalid flag like this:
corectl -c corectlconf.yaml eval "Count([Name/Alias])" --traffic --json --json is invalid.

This will then return the same value as this command:
corectl -c corectlconf.yaml eval "Count([Name/Alias])"
In my conf file I've specified engine, header and app.

@carlioth carlioth added the bug Something isn't working label Aug 30, 2019
@wennmo
Copy link
Member

wennmo commented Aug 30, 2019

Actually --json is a global flag and can be passed to all commands, so it is still a valid flag for the eval command. However there is not any json output defined for the eval command hence the flag is just silently ignored.

From the help: --json Returns output in JSON format if possible, disables verbose and traffic output

@wennmo
Copy link
Member

wennmo commented Aug 30, 2019

We could add the json flag only for the commands that are applicable, which would render in an error if passed to a command not supporting json output.

@wennmo wennmo added the v2 label Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working v2
Projects
None yet
Development

No branches or pull requests

2 participants