|
| 1 | +`Basic` Options |
| 2 | +=============== |
| 3 | + |
| 4 | +.. include:: /scancode-toolkit/rst_snippets/basic_options.rst |
| 5 | + |
| 6 | +---- |
| 7 | + |
| 8 | +.. include:: /scancode-toolkit/rst_snippets/note_snippets/synopsis_install_quickstart.rst |
| 9 | + |
| 10 | +---- |
| 11 | + |
| 12 | +``--generated`` Options |
| 13 | +----------------------- |
| 14 | + |
| 15 | + The ``--generated`` option classifies automatically generated code files with a flag. |
| 16 | + |
| 17 | + An example of using ``--generated`` in a scan:: |
| 18 | + |
| 19 | + scancode -clpieu --json-pp output.json samples --generated |
| 20 | + |
| 21 | + In the results, for each file the following attribute is added with it's corresponding |
| 22 | + ``true``/``false`` value :: |
| 23 | + |
| 24 | + "is_generated": true |
| 25 | + |
| 26 | + In the samples folder, the following files have a true value for their is_generated attribute:: |
| 27 | + |
| 28 | + "samples/zlib/dotzlib/LICENSE_1_0.txt" |
| 29 | + "samples/JGroups/licenses/apache-2.0.txt" |
| 30 | + |
| 31 | + .. |
| 32 | + [ToDo] Research and Write Better |
| 33 | +
|
| 34 | +---- |
| 35 | + |
| 36 | +``--max-email`` Options |
| 37 | +----------------------- |
| 38 | + |
| 39 | + .. admonition:: Dependency |
| 40 | + |
| 41 | + The option ``--max-email`` is a sub-option of and requires the option ``--email``. |
| 42 | + |
| 43 | + If in the files that are scanned, in individual files, there are a lot of emails (i.e lists) which |
| 44 | + are unnecessary and clutter the scan results, ``--max-email`` option can be used to report emails |
| 45 | + only up to a limit in individual files. |
| 46 | + |
| 47 | + Some important INTEGER values of the ``--max-email INTEGER`` option: |
| 48 | + |
| 49 | + - 0 - No limit, include all emails. |
| 50 | + - 50 - Default. |
| 51 | + |
| 52 | + An example usage:: |
| 53 | + |
| 54 | + scancode -clpieu --json-pp output.json samples --max-email 5 |
| 55 | + |
| 56 | + This only reports 5 email addresses per file and ignores the rest. |
| 57 | + |
| 58 | +---- |
| 59 | + |
| 60 | +``--max-url`` Options |
| 61 | +--------------------- |
| 62 | + |
| 63 | + .. admonition:: Dependency |
| 64 | + |
| 65 | + The option ``--max-url`` is a sub-option of and requires the option ``--url``. |
| 66 | + |
| 67 | + If in the files that are scanned, in individual files, there are a lot of links to other websites |
| 68 | + (i.e url lists) which are unnecessary and clutter the scan results, ``--max-url`` option can be |
| 69 | + used to report urls only up to a limit in individual files. |
| 70 | + |
| 71 | + Some important INTEGER values of the ``--max-url INTEGER`` option: |
| 72 | + |
| 73 | + - 0 - No limit, include all urls. |
| 74 | + - 50 - Default. |
| 75 | + |
| 76 | + An example usage:: |
| 77 | + |
| 78 | + scancode -clpieu --json-pp output.json samples --max-url 10 |
| 79 | + |
| 80 | + This only reports 10 urls per file and ignores the rest. |
| 81 | + |
| 82 | +---- |
| 83 | + |
| 84 | +``--license-score`` Options |
| 85 | +--------------------------- |
| 86 | + |
| 87 | + .. admonition:: Dependency |
| 88 | + |
| 89 | + The option ``--license-score`` is a sub-option of and requires the option ``--license``. |
| 90 | + |
| 91 | + .. |
| 92 | + [ToDo] Research and Write License Matching Better |
| 93 | +
|
| 94 | + License matching strictness, i.e. How closely matched licenses are detected in a scan, can be |
| 95 | + modified by using this ``--license-score`` option. |
| 96 | + |
| 97 | + Some important INTEGER values of the ``--license-score INTEGER`` option: |
| 98 | + |
| 99 | + - **0** - Default and Lowest Value, All matches are reported. |
| 100 | + - **100** - Highest Value, Only licenses with a much better match are reported |
| 101 | + |
| 102 | + Here, a bigger number means a better match, i.e. Setting a higher license score translates to a |
| 103 | + higher threshold for matching licenses (with equal or less number of license matches). |
| 104 | + |
| 105 | + An example usage:: |
| 106 | + |
| 107 | + scancode -clpieu --json-pp output.json samples --license-score 70 |
| 108 | + |
| 109 | + Here's the license results on setting the integer value to 100, Vs. the default value 0. This is |
| 110 | + visualized using ScanCode workbench in the License Info Dashboard. |
| 111 | + |
| 112 | + .. list-table:: License scan results of Samples Directory. |
| 113 | + |
| 114 | + * - .. figure:: data/core_lic_score_0.png |
| 115 | + |
| 116 | + License Score 0 (Default). |
| 117 | + |
| 118 | + - .. figure:: data/core_lic_score_100.png |
| 119 | + |
| 120 | + License Score 100. |
| 121 | + |
| 122 | +---- |
| 123 | + |
| 124 | +``--license-text`` Options |
| 125 | +-------------------------- |
| 126 | + |
| 127 | + .. admonition:: Dependency |
| 128 | + |
| 129 | + The option ``--license-text`` is a sub-option of and requires the option ``--license``. |
| 130 | + |
| 131 | + .. admonition:: Sub-Option |
| 132 | + |
| 133 | + The option ``--license-text-diagnostics`` and ``--is-license-text`` are sub-options of |
| 134 | + ``--license-text``. ``--is-license-text`` is a Post-Scan Option. |
| 135 | + |
| 136 | + With the ``--license-text`` option, the scan results attribute "matched text" includes the matched text |
| 137 | + for the detected license. |
| 138 | + |
| 139 | + An example Scan:: |
| 140 | + |
| 141 | + scancode -cplieu --json-pp output.json samples --license-text |
| 142 | + |
| 143 | + An example matched text included in the results is as follows:: |
| 144 | + |
| 145 | + "matched_text": |
| 146 | + " This software is provided 'as-is', without any express or implied |
| 147 | + warranty. In no event will the authors be held liable for any damages |
| 148 | + arising from the use of this software. |
| 149 | + Permission is granted to anyone to use this software for any purpose, |
| 150 | + including commercial applications, and to alter it and redistribute it |
| 151 | + freely, subject to the following restrictions: |
| 152 | + 1. The origin of this software must not be misrepresented; you must not |
| 153 | + claim that you wrote the original software. If you use this software |
| 154 | + in a product, an acknowledgment in the product documentation would be |
| 155 | + appreciated but is not required. |
| 156 | + 2. Altered source versions must be plainly marked as such, and must not be |
| 157 | + misrepresented as being the original software. |
| 158 | + 3. This notice may not be removed or altered from any source distribution. |
| 159 | + |
| 160 | + Jean-loup Gailly Mark Adler |
| 161 | + |
| 162 | + |
| 163 | + - The file in which this license was detected: ``samples/arch/zlib.tar.gz-extract/zlib-1.2.8/zlib.h`` |
| 164 | + - License name: "ZLIB License" |
| 165 | + |
| 166 | +---- |
| 167 | + |
| 168 | +``--license-url-template`` Options |
| 169 | +---------------------------------- |
| 170 | + |
| 171 | + .. admonition:: Dependency |
| 172 | + |
| 173 | + The option ``--license-url-template`` is a sub-option of and requires the option |
| 174 | + ``--license``. |
| 175 | + |
| 176 | + The ``--license-url-template`` option sets the template URL used for the license reference URLs. |
| 177 | + |
| 178 | + The default template URL is : [https://enterprise.dejacode.com/urn/urn:dje:license:{}] |
| 179 | + In a template URL, curly braces ({}) are replaced by the license key. |
| 180 | + |
| 181 | + So, by default the license reference URL points to the dejacode page for that license. |
| 182 | + |
| 183 | + A scan example using the ``--license-url-template TEXT`` option :: |
| 184 | + |
| 185 | + scancode -clpieu --json-pp output.json samples --license-url-template https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/{}.yml |
| 186 | + |
| 187 | + In a normal scan, reference url for "ZLIB License" is as follows:: |
| 188 | + |
| 189 | + "reference_url": "https://enterprise.dejacode.com/urn/urn:dje:license:zlib", |
| 190 | + |
| 191 | + After using the option in the following manner:: |
| 192 | + |
| 193 | + ``--license-url-template https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/{}`` |
| 194 | + |
| 195 | + the reference URL changes to this `zlib.yml file <https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/data/licenses/zlib.yml>`_:: |
| 196 | + |
| 197 | + "reference_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", |
| 198 | + |
| 199 | + The reference URL changes for all detected licenses in the scan, across the scan result file. |
| 200 | + |
| 201 | +---- |
| 202 | + |
| 203 | +``--license-text-diagnostics`` Options |
| 204 | +-------------------------------------- |
| 205 | + |
| 206 | + .. admonition:: Dependency |
| 207 | + |
| 208 | + The option ``--license-text-diagnostics`` is a sub-option of and requires the options |
| 209 | + ``--license`` and ``--license-text``. |
| 210 | + |
| 211 | + In the matched license text, include diagnostic highlights surrounding with square brackets [] |
| 212 | + words that are not matched. |
| 213 | + |
| 214 | + In a normal scan, whole lines of text are included in the matched license text, including parts |
| 215 | + that are possibly unmatched. |
| 216 | + |
| 217 | + An example Scan:: |
| 218 | + |
| 219 | + scancode -cplieu --json-pp output.json samples --license-text --license-text-diagnostics |
| 220 | + |
| 221 | + Running a scan on the samples directory with ``--license-text --license-text-diagnostics`` options, |
| 222 | + causes the following difference in the scan result of the file |
| 223 | + ``samples/JGroups/licenses/bouncycastle.txt``. |
| 224 | + |
| 225 | + Without Diagnostics:: |
| 226 | + |
| 227 | + "matched_text": |
| 228 | + "License Copyright (c) 2000 - 2006 The Legion Of The Bouncy Castle |
| 229 | + (http://www.bouncycastle.org) Permission is hereby granted, free of charge, to any person |
| 230 | + obtaining a copy of this software and associated documentation files (the \"Software\"), |
| 231 | + to deal in the Software without restriction |
| 232 | + |
| 233 | + With Diagnostics on:: |
| 234 | + |
| 235 | + "matched_text": |
| 236 | + "License [Copyright] ([c]) [2000] - [2006] [The] [Legion] [Of] [The] [Bouncy] [Castle] |
| 237 | + ([http]://[www].[bouncycastle].[org]) Permission is hereby granted, free of charge, to any person |
| 238 | + obtaining a copy of this software and associated documentation files (the \"Software\"), |
| 239 | + to deal in the Software without restriction, |
0 commit comments