Skip to content

Commit

Permalink
improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
sensslen committed Aug 15, 2024
1 parent 7ce539d commit b4ada34
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ Usage: nuget-license [options]

| Option | Description |
| ------ | ------------------------- |
| `-i, --input` | Project or Solution to be analyzed |
| `-ji, --json-input` | Similar to `-i, --input` but providing a file containing a valid JSON Array that contains all projects to be analyzed |
| `-t, --include-transitive` | When set, the analysis includes transitive packages (dependencies of packages that are directly installed to the project) |
| `-a, --allowed-license-types` | File containing all allowed licenses in JSON format. If omitted, all licenses are considered to be allowed. |
| `-ignore, --ignored-packages` | File containing a JSON formatted array containing package names, that should be ignored when validating licenses. Package names specified can contain simple Wildcard characters (*) which are used to match any number of characters. Note that even though a package is ignored, it's transitive dependencies are still validated. This Option is useful e.g. to exclude homegrown nuget packages from validation. |
| `-exclude-projects, --exclude-projects-matching` | This option allows to specify project name(s) to exclude from the analysis. This can be useful to exclude test projects from the analysis when supplying a solution file as input. Wildcard characters (*) are supported to specify ranges of ignored projects. The input can either be a file name containing a list of project names in json format or a plain string that is then used as a single enty. |
| `-include-ignored, --include-ignored-packages` | This flag allows to explicitly include ignored packages in the output. |
| `-mapping, --licenseurl-to-license-mappings` | When used, this option allows to add to the url to license mapping built into the application (see [here](src/NuGetUtility/LicenseValidator/UrlToLicenseMapping.cs)) |
| `-override, --override-package-information` | When used, this option allows to override the package information used for the validation. This makes sure that no attempt is made to get the associated information about the package from the available web resources. This is useful for packages that e.g. provide a license file as part of the nuget package which (at the time of writing) cannot be used for validation and thus requires the package's information to be provided by this option. |
| `-d, --license-information-download-location` | When used, this option downloads the html content of the license URL to the specified folder. This is done for all NuGet packages that specify a license URL instead of providing the license expression. |
| `-o, --output` | This Parameter accepts the value `table`, `json` or `jsonPretty`. It allows to select the type of output that should be given. If omitted, the output is given in tabular form. |
| `-err, --error-only` | This flag allows to print only packages that contain validation errors (if there are any). This allows the user to focus on errors instead of having to deal with many properly validated |
| `-?, -h, --help` | Show help for the application and exit |
| `--version` | Show version information of the application and exit |
| `--version` | Show version information. |
| `-i\|--input <INPUT_FILE>` | The project (or solution) file for which to analyze dependency licenses |
| `-ji\|--json-input <INPUT_JSON_FILE>` | File in json format that contains an array of all files to be evaluated. The Files can either point to a project or a solution. |
| `-t\|--include-transitive` | If set, the whole license tree is followed in order to determine all nuget's used by the projects |
| `-a\|--allowed-license-types <ALLOWED_LICENSES>` | File in json format that contains an array of all allowed license types |
| `-ignore\|--ignored-packages <IGNORED_PACKAGES>` | File in json format that contains an array of nuget package names to ignore (e.g. useful for nuget packages built in-house). Note that even though the packages are ignored, their transitive dependencies are not. Wildcard characters (*) are supported to specify ranges of ignored packages. |
| `-mapping\|--licenseurl-to-license-mappings <LICENSE_MAPPING>` | File in json format that contains a dictionary to map license urls to licenses. |
| `-override\|--override-package-information <OVERRIDE_PACKAGE_INFORMATION>` | File in json format that contains a list of package and license information which should be used in favor of the online version. This option can be used to override the license type of packages that e.g. specify the license as file. |
| `-d\|--license-information-download-location <DOWNLOAD_LICENSE_INFORMATION>` | When set, the application downloads all licenses given using a license URL to the specified folder. |
| `-o\|--output <OUTPUT_TYPE>` | This parameter allows to choose between tabular and json output. Allowed values are: Table, Json, JsonPretty. Default value is: Table. |
| `-err\|--error-only` | If this option is set and there are license validation errors, only the errors are returned as result. Otherwise all validation results are always returned. |
| `-include-ignored\|--include-ignored-packages` | If this option is set, the packages that are ignored from validation are still included in the output. |
| `-exclude-projects\|--exclude-projects-matching <EXCLUDED_PROJECTS>` | This option allows to specify project name(s) to exclude from the analysis. This can be useful to exclude test projects from the analysis when supplying a solution file as input. Wildcard characters (*) are supported to specify ranges of ignored projects. The input can either be a file name containing a list of project names in json format or a plain string that is then used as a single entry. |
| `-?\|-h\|--help` | Show help information. |

## Example tool commands

Expand Down
2 changes: 1 addition & 1 deletion src/NuGetUtility/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class Program
{
[Option(ShortName = "i",
LongName = "input",
Description = "The project (or solution) file who's dependencies should be analyzed")]
Description = "The project (or solution) file for which to analyze dependency licenses")]
public string? InputFile { get; } = null;

[Option(ShortName = "ji",
Expand Down

0 comments on commit b4ada34

Please sign in to comment.