cmd/exec: add --fail and --fail-defined flags (#5295)
Adds the ability to exit with a non-zero exit code for 'opa exec' by adding the --fail and --fail-defined flags matching their respective behaviors in 'opa eval': - Setting the --fail-defined flag allows exit of opa exec with a zero code if all results are undefined and there are no errors, or a non-zero code in the event of any defined results and/or errors. On non-zero exits the error message includes the number of failures/errors as well as a reference to the --fail-defined flag being set. - The --fail flag behaves as the inverse of --fail-defined. Fixes: #5007 Signed-off-by: Byron Lagrone <byron.lagrone@seqster.com>
B
Byron Lagrone committed
235ee309da100534ab248c6455c8efdb74f49c3c
Parent: cdbe363
Committed by GitHub <noreply@github.com>
on 10/26/2022, 8:43:07 AM