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

Add more output options for list and cache commands #334

Merged
merged 2 commits into from
Feb 8, 2021

Conversation

jonabc
Copy link
Contributor

@jonabc jonabc commented Feb 8, 2021

This branch makes a few relatively small changes as followup to some quick exploration while looking at an issue report

This got me curious and I've put together a quick change locally that could give something like the above output by (1) extending licensed list to support different output formats and (2) including more information in the output. That unfortunately has some performance implications to that command so I'd need to review and see how to make the new functionality available without degrading general usage.

  1. Adds the "format" CLI flag to the list and cache commands and passes the flag into each commands' run call. Usage of the flag is already handled by the base command class so no further changes are needed to support JSON and YML output
  2. Sets some dependency metadata into the list commands report object to be included in JSON/YML output
  3. Adds a new CLI flag -l/--licenses to the list command that includes the detected license key in the output.
    • the default list output will look like name (version): license
    • included in json and YML as the license key on each dependency

/cc @lowlighter FYI

@jonabc jonabc merged commit a43fde6 into master Feb 8, 2021
@jonabc jonabc deleted the more-list-data-more-formats branch February 8, 2021 17:31
@lowlighter
Copy link

Awesome!

Is there an ETA yet for v2.14.4 ?

@jonabc
Copy link
Contributor Author

jonabc commented Feb 8, 2021

There's not but there's nothing to stop cutting a new release today/tomorrow if it would be useful for you

@lowlighter
Copy link

That would be nice, though I'm not in a hurry so if there are still some stuff to implement toward 2.14.4 I can wait 🙂

jonabc added a commit that referenced this pull request Feb 9, 2021
## 2.14.4
2021-02-09

## Added
- `list` and `cache` commands optionally print output in JSON or YML formats using the `--format/-f` flag (#334)
- `list` command will include detected license keys using the `--licenses/-l` flag (#334)
@jonabc jonabc mentioned this pull request Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants