opa
opa copied to clipboard
Add optimize flag to OPA subcommands
In the same way that we recently added a -t/--target flag to opa eval, opa test, etc. it would be nice to have a flag to enable/control the optimization level in OPA. Currently the -O/--optimize flag is only used by the opa build
command however there is no reason we couldn't expose it on eval, test, etc. This would be quite useful for test purposes (in the same way the --target flag is.)
Adding support for -O/--optimize would be a little bit more work than the target flag as it would require integration of the compile package into various places.
To make the -O
flag work we would also have to include an -e
/--entrypoint
flag to specify the entrypoints for partial evaluation.
This PR adds the optimize flag on the opa eval
command.