Skip to content

Commit 2a1f596

Browse files
Update outdated documentation sections
Also update documentation formatting and pages layout/sections. Signed-off-by: Ayan Sinha Mahapatra <asmahapatra@aboutcode.org>
1 parent 037c101 commit 2a1f596

15 files changed

+163
-70
lines changed

docs/source/reference/index.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,3 @@ Technical reference material.
1111
scancode-cli/index.rst
1212
scancode-plugins/index.rst
1313
scancode-supported-packages
14-
extractcode-cli
15-
scancode-reindex-licenses-cli

docs/source/reference/scancode-cli/cli-core-options.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Comparing progress message options
1818

1919
**Default progress message**
2020

21+
By default a rolling progress bar and scanned file count is shown.
22+
2123
.. code-block:: none
2224
2325
Scanning files for: infos, licenses, copyrights, packages, emails, urls with 1 process(es)...

docs/source/reference/extractcode-cli.rst renamed to docs/source/reference/scancode-cli/cli-extractcode.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Archives within an extracted archive are extracted **recursively** by default,
1111
with the extraction occurring in a directory named "-extract" alongside the original archive.
1212

1313
**Quick Reference**
14+
-------------------
1415

1516
--shallow Do not extract recursively nested archives (e.g. Not
1617
archives in archives).
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
.. _cli-scancode-license-data:
2+
3+
scancode license data CLI
4+
=========================
5+
6+
Scancode includes the license data for all the licenses in detects
7+
as scancode-licensedb with the license texts and other reference data
8+
like license category, authors, and reference links.
9+
10+
``scancode-license-data`` is a CLI command to provide this license data
11+
in a structured format that is API, and this includes:
12+
13+
- all the license details, without license text, in one JSON/YAML file
14+
- all the individual licenses, with license text, in JSON/YAML files
15+
- locally built HTML page with a searchable table of all licenses
16+
- locally built HTML pages for all individual licenses with its text and details
17+
18+
The data and HTML pages are dumped into a folder specified by the required
19+
CLI option ``--path``.
20+
21+
The licensedb is also hosted at https://scancode-licensedb.aboutcode.org/ and is
22+
updated daily from the latest added licenses from the scancode ``develop`` branch
23+
using the ``scancode-license-data`` CLI option.
24+
25+
Usage: ``scancode-license-data [OPTIONS]``
26+
27+
**Quick Reference**
28+
-------------------
29+
30+
--path DIR Dump the license data in this directory in the LicenseDB format
31+
and exit. Creates the directory if it does not exist.
32+
[required]
33+
-h, --help Show this message and exit.
34+

docs/source/reference/scancode-reindex-licenses-cli.rst renamed to docs/source/reference/scancode-cli/cli-scancode-reindex-licenses.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The ``scancode-reindex-licenses`` command rebuilds the license index.
1010
Usage: ``scancode-reindex-licenses [OPTIONS]``
1111

1212
Quick Reference
13-
^^^^^^^^^^^^^^^
13+
---------------
1414

1515
--all-languages [EXPERIMENTAL] Rebuild the license index
1616
including texts all languages (and not only

docs/source/reference/scancode-cli/index.rst

Lines changed: 48 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,72 +3,88 @@
33
**ScanCode CLI**
44
================
55

6-
.. toctree::
7-
:hidden:
8-
9-
cli-help-text-options
10-
cli-basic-options
11-
cli-core-options
12-
cli-output-format-options
13-
cli-output-control-and-filter-options
14-
cli-pre-scan-options
15-
cli-post-scan-options
16-
176
Below is a quick reference of all ScanCode options.
18-
For detailed descriptions and examples, please refer to the chapters in the table of contents.
7+
For detailed descriptions and examples, please refer to the chapters in the table of
8+
contents or the link to the detailed CLI options at the end of each section.
199

20-
The order of the sections and all their options is the same as in the :ref:`cli-help-option`,
21-
available in the command line.
10+
This has the same CLI options in the :ref:`cli-help-option`, available in the command line
11+
but with more details and additional references.
2212

2313
----
2414

2515
.. _cli-scancode-basic-options:
2616

27-
**Basic options**
28-
2917
.. include:: /rst-snippets/cli-basic-options.rst
30-
:start-line: 3
18+
19+
For more details into the basic CLI options, see :ref:`cli-basic-options`.
3120

3221
----
3322

3423
.. _cli-scancode-core-options:
3524

36-
**Core options**
37-
3825
.. include:: /rst-snippets/cli-core-options.rst
39-
:start-line: 3
26+
27+
For more details into the core CLI options, see :ref:`cli-core-options`.
28+
4029
----
4130

4231
.. _cli-scancode-output-format-options:
4332

44-
**Output formats**
45-
4633
.. include:: /rst-snippets/cli-output-format-options.rst
47-
:start-line: 3
34+
35+
For more details into the output format CLI options, see :ref:`cli-output-format-options`.
4836

4937
----
5038

5139
.. _cli-scancode-output-control-and-filter-options:
5240

53-
**Controlling output and filters**
54-
5541
.. include:: /rst-snippets/cli-output-control-and-filter-options.rst
56-
:start-line: 3
42+
43+
For more details into the output filter CLI options, see
44+
:ref:`cli-output-control-and-filter-options`.
5745

5846
----
5947

6048
.. _cli-scancode-pre-scan-options:
6149

62-
**Pre-scan options**
63-
6450
.. include:: /rst-snippets/cli-pre-scan-options.rst
65-
:start-line: 3
51+
52+
For more details into the pre-scan CLI options, see :ref:`cli-pre-scan-options`.
6653

6754
----
6855

6956
.. _cli-scancode-post-scan-options:
7057

71-
**Post-scan options**
72-
7358
.. include:: /rst-snippets/cli-post-scan-options.rst
74-
:start-line: 3
59+
60+
For more details into the post-scan CLI options, see :ref:`cli-post-scan-options`.
61+
62+
----
63+
64+
.. _cli-other-commands:
65+
66+
.. include:: /rst-snippets/cli-other-commands.rst
67+
68+
----
69+
70+
.. _cli-doc-help-options:
71+
72+
.. include:: /rst-snippets/cli-doc-help-options.rst
73+
74+
----
75+
76+
**Detailed reference for CLI options/commands**
77+
-----------------------------------------------
78+
79+
.. toctree::
80+
81+
cli-help-text-options
82+
cli-basic-options
83+
cli-core-options
84+
cli-output-format-options
85+
cli-output-control-and-filter-options
86+
cli-pre-scan-options
87+
cli-post-scan-options
88+
cli-extractcode
89+
cli-scancode-reindex-licenses
90+
cli-scancode-license-data

docs/source/rst-snippets/cli-basic-options.rst

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
"basic" options
2-
---------------
1+
**Basic options**
2+
-----------------
33

44
Option lists are two-column lists of command-line options and descriptions,
55
documenting a program's options. For example:
@@ -33,9 +33,11 @@ documenting a program's options. For example:
3333
--system-package Scan ``<input>`` for installed system package
3434
databases.
3535

36-
--package-only Scan ``<input>`` for system and application
37-
only for package metadata, without license/
38-
copyright detection and package assembly.
36+
--package-only Faster package scan, scanning ``<input>`` for
37+
system and application packages, only for package
38+
metadata. This option is skipping
39+
- license and copyright detection for package metadata
40+
- package assembly
3941

4042
-e, --email Scan ``<input>`` for emails.
4143

@@ -68,19 +70,26 @@ documenting a program's options. For example:
6870
--generated Classify automatically generated code files with a flag.
6971

7072
--max-email INT Report only up to INT emails found in a
71-
file. Use 0 for no limit. [Default: 50]
73+
file. Use 0 for no limit.
74+
75+
Default: ``50``
7276

7377
Sub-option of: ``--email``
7478

7579
--max-url INT Report only up to INT urls found in a
76-
file. Use 0 for no limit. [Default: 50]
80+
file. Use 0 for no limit.
81+
82+
Default: ``50``
7783

7884
Sub-option of: ``--url``
7985

8086
--license-score INTEGER
8187

8288
Do not return license matches with scores lower than this score.
83-
A number between 0 and 100. [Default: 0]
89+
A number between 0 and 100.
90+
91+
Default: ``0`` (i.e. we return all license matches by default).
92+
8493
Here, a bigger number means a better match, i.e. Setting a higher license score
8594
translates to a higher threshold (with equal or smaller number of matches).
8695

@@ -101,7 +110,8 @@ documenting a program's options. For example:
101110
Set the template URL used for the license reference URLs.
102111

103112
In a template URL, curly braces ({}) are replaced by the license key.
104-
[Default: default: https://scancode-licensedb.aboutcode.org/{}]
113+
114+
Default: ``https://scancode-licensedb.aboutcode.org/{}``
105115

106116
Sub-option of: ``--license``
107117

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,37 @@
1-
"core" options
2-
--------------
1+
**Core options**
2+
----------------
33

44
-n, --processes INTEGER Scan ``<input>`` using n parallel processes.
5-
[Default: (number of CPUs)-1]
5+
6+
Default: ``(number of CPUs)-1``
67

78
-v, --verbose Print verbose file-by-file progress messages.
89

910
-q, --quiet Do not print summary or progress messages.
1011

1112
--timeout FLOAT Stop scanning a file if scanning takes longer
12-
than a timeout in seconds. [Default: 120]
13+
than a timeout in seconds.
14+
15+
Default: ``120``
16+
17+
--from-json Load codebase from one or more existing JSON scans to:
1318

14-
--from-json Load codebase from one or more existing JSON scans.
19+
- apply post-scan options to do additional processing
20+
of scan results
21+
- merge multiple JSON scans into one.
1522

1623
--max-in-memory INTEGER Maximum number of files and directories scan
1724
details kept in memory during a scan.
1825
Additional files and directories scan details
1926
above this number are cached on-disk rather
2027
than in memory. Use 0 to use unlimited memory
2128
and disable on-disk caching. Use -1 to use
22-
only on-disk caching. [Default: 10000]
29+
only on-disk caching.
30+
31+
Default: ``10000``
2332

2433
--max-depth INTEGER Descend at most INTEGER levels of directories
2534
including and below the starting point. INTEGER
2635
must be positive or zero for no limit.
27-
[Default: 0]
36+
37+
Default: ``0``

docs/source/rst-snippets/cli-doc-help-options.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Documentation/help options
2-
--------------------------
1+
**Documentation/help options**
2+
------------------------------
33

44
-h, --help Show the :ref:`cli-help-option` and exit.
55

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
**Other CLI commands**
2+
----------------------
3+
4+
-n, --processes INTEGER Scan ``<input>`` using n parallel processes.
5+
6+
Default: ``(number of CPUs)-1``
7+
8+
-v, --verbose Print verbose file-by-file progress messages.
9+
10+
-q, --quiet Do not print summary or progress messages.

0 commit comments

Comments
 (0)