Commit Graph

10 Commits

Author SHA1 Message Date
Stephan Renatus ed14340916 cmd/exec: remove "pretty" format (#6923)
This was never supported, and the flag is thus confusing. Since the
only supported format is "json" (the default), the flag is redundant
now. However, I've kept it so if someone uses `opa exec --format=json`
somewhere, their calls won't become invalid.

If someone had been using `opa exec --format=pretty`, they will now
see an error, but I think that's less confusing: pretty formatting
is just not supported for 'opa exec'.

Signed-off-by: Stephan Renatus <stephan@styra.com>
2024-08-13 14:40:44 +02:00
Johan Fylling e50a3061f5 cmd/exec: Supporting simultaneous input from stdin and files (#6831)
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2024-06-26 15:54:01 +02:00
Colin J Lacy 96800d747b cmd/exec: adds --stdin-input (-I) flag for input piping or manual entry (#6822)
Signed-off-by: Colin Lacy <colinjlacy@gmail.com>
2024-06-26 15:04:54 +02:00
Philip Conrad 6b7ede0ee0 cmd/exec: Add timeout flag to help prevent infinite hangs. (#6633)
This commit adds a `--timeout` duration flag to the `opa exec` CLI command.
This flag helps out in use cases such as CI, where stalling indefinitely
is undesirable behavior.

Fixes: #6613

Signed-off-by: Philip Conrad <philipaconrad@gmail.com>
2024-03-18 12:22:41 -04:00
Johan Fylling b36151d992 Adding --v1-compatible flag to all previously unsupported command line commands (#6521)
In addition to those commands already supported:

* build
* check
* eval
* fmt
* test

support has been added to the following commands:

* `bench`
* `deps`
* `exec`
* `inspect`
* `parse`
* `run` (command `server` and `REPL`)

Fixes: #6520

Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2024-01-24 15:42:32 +01:00
Ronnie-personal c3854aa6ae feat(cmd): Adding fail-non-empty flag (#6153)
Add fail-non-empty flag to opa exec

Signed-off-by: Ronnie Personal <76408835+Ronnie-personal@users.noreply.github.com>
2023-08-21 11:30:25 +02:00
Anders Eknert 9a597feb2e chore: don't use the deprecated ioutil functions (#5319)
Another annoyance removed :P

Signed-off-by: Anders Eknert <anders@eknert.com>
2022-10-27 14:30:26 +02:00
Byron Lagrone 235ee309da 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>
2022-10-26 10:43:07 +02:00
Sergey Vilgelm 5e51af9244 logger: Configure timestamp format (#5050)
With this, we allow the user to configure the logger's timestamp format by:
* cli argument `log-timestamp-format`
* environment variable `OPA_LOG_TIMESTAMP_FORMAT`

Fixes #2413.

Signed-off-by: Sergey Vilgelm <sergey@vilgelm.com>
2022-08-29 14:23:48 +02:00
Torin Sandall 55b053b79a cmd/exec: Add new exec subcommand
This is just a skeleton but the basic functionality is there: run OPA
in a "one shot" mode against a set of input files and print the
results for each.

Fixes #3525

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2021-12-22 17:46:37 +01:00