aboutsummaryrefslogtreecommitdiff
path: root/examples/README.md
diff options
context:
space:
mode:
authorCatalinStratu <catalinstratu45@gmail.com>2022-03-31 03:30:42 +0300
committerGitHub <noreply@github.com>2022-03-30 20:30:42 -0400
commit7e3a22cfccbda131ebfb0d29e089a274950726ce (patch)
treef05b5515ac82a7d6f855df768f1ec29ae9e42105 /examples/README.md
parentd93d09feb83ecac722c16d3ccaa97c961c695465 (diff)
downloadspdx-tools-7e3a22cfccbda131ebfb0d29e089a274950726ce.tar.gz
examples: Add comments with sample run commands (#123)
Signed-off-by: CatalinStratu <catalinstratu45@gmail.com>
Diffstat (limited to 'examples/README.md')
-rw-r--r--examples/README.md14
1 files changed, 11 insertions, 3 deletions
diff --git a/examples/README.md b/examples/README.md
index bd4b3d3..fb201ba 100644
--- a/examples/README.md
+++ b/examples/README.md
@@ -11,6 +11,7 @@ tools-golang sub-packages.
This example demonstrates loading an SPDX tag-value file from disk into memory,
and printing some of its contents to standard output.
+#### Run project: *go run example_load.go ../sample-docs/example1/spdx/SPDXTagExample-v2.2.spdx*
## 2-load-save/
@@ -18,7 +19,7 @@ and printing some of its contents to standard output.
This example demonstrates loading an SPDX tag-value file from disk into memory,
and re-saving it to a different file on disk.
-
+#### Run project: *go run example_load_save.go ../sample-docs/example1/spdx/example1.spdx test.spdx*
## 3-build/
*builder*, *tvsaver*
@@ -26,6 +27,7 @@ and re-saving it to a different file on disk.
This example demonstrates building an 'empty' SPDX document in memory that
corresponds to a given directory's contents, including all files with their
hashes and the package's verification code, and saving the document to disk.
+#### Run project: *go run example_build.go project2 ../../testdata/project2 test.spdx*
## 4-search/
@@ -35,6 +37,7 @@ This example demonstrates building an SPDX document for a directory's contents
(implicitly using *builder*); searching through that directory for [SPDX
short-form IDs](https://spdx.org/ids/); filling those IDs into the document's
Package and File license fields; and saving the resulting document to disk.
+#### Run project: *go run example_search.go project2 ../../testdata/project2/folder test.spdx*
## 5-report/
@@ -43,7 +46,8 @@ Package and File license fields; and saving the resulting document to disk.
This example demonstrates loading an SPDX tag-value file from disk into memory,
generating a basic report listing counts of the concluded licenses for its
files, and printing the report to standard output.
-
+#### Run project: * go run example_report.go ../sample-docs/example1/spdx/SPDXTagExample-v2.2.spdx
+*
## 6-licensediff
*licensediff*, *tvloader*
@@ -55,7 +59,7 @@ with matching IDs in each document.
This is generally only useful when run with two SPDX documents that describe
licenses for subsequent versions of the same set of files, AND if they have
the same identifier in both documents.
-
+#### Run project *Run project: go run example_licensediff.go ../sample-docs/example1/spdx/SPDXTagExample-v2.2.spdx ../sample-docs/example2/spdx/SPDXTagExample2-v2.2.spdx*
## 7-rdfloader
@@ -63,6 +67,7 @@ the same identifier in both documents.
This example demonstrates loading an SPDX rdf file from disk into memory
and then printing the corresponding spdx struct for the document.
+#### Run project: *go run exampleRDFLoader.go ../sample-docs/rdf/SPDXRdfExample-v2.2.spdx.rdf*
## 8-jsontotv
@@ -70,6 +75,7 @@ and then printing the corresponding spdx struct for the document.
This example demonstrates loading an SPDX json from disk into memory
and then re-saving it to a different file on disk in tag-value format.
+#### Run project: *go run examplejsontotv.go ../sample-docs/json/SPDXJSONExample-v2.2.spdx.json example.spdx*
## 9-tvtojson
@@ -77,6 +83,7 @@ and then re-saving it to a different file on disk in tag-value format.
This example demonstrates loading an SPDX tag-value from disk into memory
and then re-saving it to a different file on disk in json format.
+#### Run project: *go run exampletvtojson.go ../sample-docs/example1/spdx/SPDXTagExample-v2.2.spdx example.json*
## 10-jsonloader
@@ -84,3 +91,4 @@ and then re-saving it to a different file on disk in json format.
This example demonstrates loading an SPDX json from disk into memory
and then logging some of the attributes to the console.
+#### Run project: *go run example_json_loader.go ../sample-docs/json/SPDXJSONExample-v2.2.spdx.json example.spdx* \ No newline at end of file