nodeshift-archived / license-reporter

license-reporter is a tool that gathers licenses for project's dependencies and produces a output in XML, JSON, YAML and HTML format.
Apache License 2.0
13 stars 10 forks source link

commands and options #226

Closed helio-frota closed 7 years ago

helio-frota commented 7 years ago

I was reading yargs documentation and it seems to be possible to have something like:

license-reporter merge --licenses=foo.xml, bar.xml 
or
license-reporter save --json

If is possible to do it then maybe we can delegate some validation and have more consistence with command and project code, by having something like:

$ license-reporter
only console output
$ license-reporter save 
will save to file and need to provide at least one file type as :
$ license-reporter save --xml
$ license-reporter report
will create the HTML report
$ license-reporter merge --product-name="UberProject" --licenses="foo.xml, bar.xml" --output="Merged.xml"
helio-frota commented 7 years ago

Another example, currently this makes no sense license-reporter --silent

helio-frota commented 7 years ago

update:

helio-frota commented 7 years ago

We need to keep (MIT OR APACHE-2.0) instead MIT and APACHE-2.0 (in the link label on Local licenses column) because we currently can not identify what's inside the license file.

  1. There may be cases where the project has the MIT license defined in package.json, the file is named LICENSE-Apache-2.0 but the content is MIT.
  2. In the case of dual license (and this specific example of JSONStream), there is only the file LICENSE-Apache-2.0

In this case I decided to keep the label "JSONSTREAM_ (MIT OR APACHE-2.0) .TXT" and both links point to the Apache-2.0 licensed file since the MIT license file does not exist (in this specific case). Instead of adding the "Local File Not Found" message,

capture

If any changes are required please open a issue.