Files
releases/cmd
Stephan Renatus 6f646b7a79 cmd/build: return error if there is more than one positional argument
Before, this would only return an error if there was no query argument.

However, I've run into this recently, running the erroneous command

    opa build -o out.wasm 'data.simplest.allow = x' simplest.rego

which produced no error, the resulting wasm file wasn't what I was
expecting.

With this change, the bad command line would give an error; and might
prompt the user to re-read the usage text and provide the proper command
instead,

    opa build -o out.wasm -d simplest.rego 'data.simplest.allow = x'

----

Alternatively to how it's done here, we could have provided the cobra
field

    Args: cobra.ExactArgs(1),

but the PreRunE function has a more specific error message. So, I've
taken the message from `opa deps`.

Signed-off-by: Stephan Renatus <srenatus@chef.io>
2020-01-07 17:49:10 -05:00
..
2017-03-12 12:04:35 -07:00
2016-08-02 16:57:15 -07:00
2019-10-22 10:07:03 -07:00
2019-09-27 09:55:11 -04:00
2019-09-27 09:55:11 -04:00
2019-09-04 13:39:52 -06:00
2019-09-27 09:55:11 -04:00