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

updated How_to_scan in this Doc #21

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/source/doc_maintenance.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Follow standard git procedures to upload your new and modified files. The follow
git add source/index.rst
git add source/how-to-scan.rst
git status
git commit -m "New how-to document that explains how to scan"
git commit -s -m "New how-to document that explains how to scan"(You need to sign-off every commits)
git status
git push
git status
Expand Down
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ Indices and Tables
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

58 changes: 34 additions & 24 deletions docs/source/scancode-toolkit/how_to/how_to_run_a_scan.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,46 +6,56 @@ How to Run a Scan
Quickstart
----------

ScanCode results are provided as:


#. JSON file (default)
#. html (static html)
ScanCode results are provided as:

The basic usage is:
1. JSON file (default)
2. html (static html)
3. csv

::
The basic usage is::

./scancode [OPTIONS] <input> <output_file>
./scancode [OPTIONS] <OUTPUT FORMAT(S)> <input>

OUTPUT FORMAT(S)::
--json FILE Write scan output as compact JSON to FILE.
--json-pp FILE Write scan output as pretty-printed JSON to FILE.
--json-lines FILE Write scan output as JSON Lines to FILE.
--csv FILE Write scan output as CSV to FILE.
--html FILE Write scan output as HTML to FILE.
--custom-output FILE Write scan output to FILE formatted with the custom
Jinja template file.
--custom-template FILE Use this Jinja template FILE as a custom template.
--spdx-rdf FILE Write scan output as SPDX RDF to FILE.
--spdx-tv FILE Write scan output as SPDX Tag/Value to FILE.
--html-app FILE (DEPRECATED: use the ScanCode Workbench app instead
) Write scan output as a mini HTML application to
FILE.

**Note: On Windows use scancode instead of ./scancode**
The ``<input>`` file or directory is what will be scanned for origin clues. The results will be saved to the ``FILE``.

The ``<input>`` file or directory is what will be scanned for origin clues. The results will be saved to the ``<output_file>``.
The output file format is set by using the ``-f`` or ``--format`` option. The default output format is JSON.

The following example scans will show you how to run a scan with each of the result formats. For the scans, we will use the ``samples`` directory provided with the ScanCode Toolkit.

JSON file output
----------------

Scan the ``samples`` directory and save the scan to a JSON file:
**Note: On Windows use scancode instead of ./scancode**

::
**JSON file output**

./scancode --format json samples samples.json
Scan the ``samples`` directory and save the scan to a sample JSON file::

./scancode --json samples.json samples

.. image:: scancode-toolkit-json-output.png

Static html output
------------------
.. figure:: scancode-toolkit-json-output.png
:width: 700px

Scan the ``samples`` directory for licenses and copyrights and save the scan results to an HTML file. When the scan is done, open ``samples.html`` in your web browser.
**Static html output**

::
Scan the ``samples`` directory for licenses and copyrights and save the scan results to an HTML file. When the scan is done, open ``samples.html`` in your web browser::

./scancode --format html samples samples.html
./scancode --html samples.html samples

.. image:: scancode-toolkit-static-html1.png
.. image:: scancode-toolkit-static-html2.png
.. figure:: scancode-toolkit-static-html1.png
:width: 700px
.. figure:: scancode-toolkit-static-html2.png
:width: 700px