Skip to content

Add --format json option to keys, stats, and check commands - #11

Open
shubham-dce wants to merge 1 commit into
cli-10-keys-filterfrom
cli-11-output-format
Open

Add --format json option to keys, stats, and check commands#11
shubham-dce wants to merge 1 commit into
cli-10-keys-filterfrom
cli-11-output-format

Conversation

@shubham-dce

Copy link
Copy Markdown
Owner

Summary

Adds an opt-in --format json flag to print output in json format. The plain output format remains the default. It facilitates the output to be processed to other programs if needed.

Code changes

  • Create a shared format_output function. Kept flexible for adding new format types.
  • --format is an optional flag on the keys, stats, and check commands. Choices are bounded for it in the subparsers using choice=['plain', 'json']

Testing

  • Modified the FakeExtraArgs, and FakeCheckArgs classes to accommodate the format flag.
  • Adds 5 test, pass successfully with the pre-existing tests. Test coverage is at 98.14%, meeting project's spec.

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