Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support output formats #309

Merged
merged 2 commits into from
Jan 23, 2024
Merged

Support output formats #309

merged 2 commits into from
Jan 23, 2024

Conversation

malcolmholmes
Copy link
Collaborator

Currently, Grizzly mostly exports as YAML. It would be useful if the user could
specify the format that they want their content in, e.g. JSON or YAML.

Apart from anything, this would provide a workaround for #301.

Also, the --only-spec parameter allows the user to specify whether to show
raw JSON without the envelope. This currently assumes JSON, because, well,
a raw dashboard has always been JSON. This justification makes no actual
sense.

Therefore, this PR adds a --output flag to relevant commands, allowing the
user to choose either yaml or json outputs. These can also be set in the
context with grr config set output-format json for example.

The --only-spec arg now works with any format (YAML or JSON at present).
It can also be set in the context with grr config set only-spec true.

@malcolmholmes malcolmholmes requested review from a team and theSuess January 19, 2024 12:52
@malcolmholmes malcolmholmes force-pushed the malcolmholmes/output-formats branch from ce68230 to 17c63de Compare January 19, 2024 13:35
pkg/config/model.go Show resolved Hide resolved
cmd/grr/workflow.go Show resolved Hide resolved
@malcolmholmes malcolmholmes merged commit 1646298 into main Jan 23, 2024
2 checks passed
@malcolmholmes malcolmholmes deleted the malcolmholmes/output-formats branch January 23, 2024 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants