mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-13 03:42:35 -06:00
ef9814c9ab
This is a very simple addition but it's proven extremely useful to us since it means you can now use `opa` easily in bash scripts, e.g.: ```bash ACCOUNT_ID="$(opa eval -d accounts.rego --format raw "data.accounts.account")" ``` This means `accounts.rego` can be used by policies as well as e.g. deploy scripts. The naming and functionality is inspired by the `-r` flag from `jq`. In fact, `jq` can be used to replicate this behaviour, but it is a bit nicer to not rely on that system dependency. When multiple queries and expressions are given, they are printed in a simple table format using single newlines and spaces since that is consistent and plays nice with `bash`. Signed-off-by: Jasper Van der Jeugt <jasper@fugue.co>