You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32-34
Original file line number
Diff line number
Diff line change
@@ -296,7 +296,7 @@ All commands support the `--quiet` flag. By default, the utility outputs informa
296
296
This example shows the `--quiet` flag being used on the `schema` command to turn off or "quiet" any informational output so that only the result table is displayed.
-**Note**: *The short-form `-q` (quiet) flag is equivalent to `--quiet`.*
314
-
315
313
#### Where flag (output filtering)
316
314
317
315
All `list` subcommands support the `--where` flag. It can be used to filter output results based upon matches to regular expressions (regex) by using the output list's column titles as keys.
@@ -421,7 +419,7 @@ Use the `--summary` flag on the `license list` command to produce a summary repo
421
419
This example shows a few entries of the JSON output that exhibit the three types of license data described above:
422
420
423
421
```bash
424
-
./sbom-utility license list -i examples/cyclonedx/SBOM/juice-shop-11.1.2/bom.json --format json --quiet
422
+
./sbom-utility license list -i examples/cyclonedx/SBOM/juice-shop-11.1.2/bom.json --format json -q
425
423
```
426
424
427
425
```json
@@ -465,7 +463,7 @@ This example shows a few entries of the JSON output that exhibit the three types
465
463
This example shows the default text output from using the summary flag:
466
464
467
465
```bash
468
-
./sbom-utility license list -i test/cyclonedx/cdx-1-3-license-list.json --summary --quiet
466
+
./sbom-utility license list -i test/cyclonedx/cdx-1-3-license-list.json --summary -q
469
467
```
470
468
471
469
```bash
@@ -503,7 +501,7 @@ The list command results can be filtered using the `--where` flag using the colu
503
501
The following example shows filtering of component licenses using the `license-type` column where the license was described as a `name` value:
504
502
505
503
```bash
506
-
./sbom-utility license list -i test/cyclonedx/cdx-1-3-license-list.json --summary --where license-type=name --quiet
504
+
./sbom-utility license list -i test/cyclonedx/cdx-1-3-license-list.json --summary --where license-type=name -q
We can also apply the `--summary` flag to get a reduced set of columns that includes only the `usage-policy` along with the essential SPDX license information (e.g., no annotations or notes).
@@ -1213,7 +1211,7 @@ In this example, the `--from` clause references the top-level `metadata.supplier
1213
1211
In this example, the `--from` clause references the singleton JSON object `component` found under the top-level `metadata` object. It then reduces the resultant JSON object to only return the `name` and `value` fields and their values as requested on the `--select` clause.
@@ -1327,7 +1325,7 @@ Currently, all `resource list` command results are sorted by resource `type` the
1327
1325
#### Example: resource list
1328
1326
1329
1327
```bash
1330
-
./sbom-utility resource list -i test/cyclonedx/cdx-1-3-resource-list.json --quiet
1328
+
./sbom-utility resource list -i test/cyclonedx/cdx-1-3-resource-list.json -q
1331
1329
```
1332
1330
1333
1331
```bash
@@ -1354,7 +1352,7 @@ service Foo Foo service
1354
1352
This example uses the `type` flag to specific `service`. The other valid type is `component`. Future versions of CycloneDX schema will include more resource types such as "ml" (machine learning) or "tool".
1355
1353
1356
1354
```bash
1357
-
./sbom-utility resource list -i test/cyclonedx/cdx-1-3-resource-list.json --type service --quiet
1355
+
./sbom-utility resource list -i test/cyclonedx/cdx-1-3-resource-list.json --type service -q
1358
1356
```
1359
1357
1360
1358
```bash
@@ -1367,15 +1365,15 @@ service Foo Foo service service:example.com/myservi
1367
1365
**Note** The results would be equivalent to using the `--where` filter:
1368
1366
1369
1367
```bash
1370
-
./sbom-utility resource list -i test/cyclonedx/cdx-1-3-resource-list.json --where "resource-type=service" --quiet
1368
+
./sbom-utility resource list -i test/cyclonedx/cdx-1-3-resource-list.json --where "resource-type=service" -q
1371
1369
```
1372
1370
1373
1371
##### Example: list with `name` regex match
1374
1372
1375
1373
This example uses the `where` filter on the `name` field. In this case we supply an exact "startswith" regex. for the `name` filter.
1376
1374
1377
1375
```bash
1378
-
./sbom-utility resource list -i test/cyclonedx/cdx-1-3-resource-list.json --where "name=Library A" --quiet
1376
+
./sbom-utility resource list -i test/cyclonedx/cdx-1-3-resource-list.json --where "name=Library A" -q
1379
1377
```
1380
1378
1381
1379
```bash
@@ -1571,7 +1569,7 @@ Output BOM results without `properties`:
1571
1569
##### Example: Trim `name` and `description` from entire JSON BOM
1572
1570
1573
1571
```bash
1574
-
./sbom-utility trim -i test/trim/trim-cdx-1-5-sample-small-components-only.sbom.json --keys=name,description --quiet
1572
+
./sbom-utility trim -i test/trim/trim-cdx-1-5-sample-small-components-only.sbom.json --keys=name,description -q
1575
1573
```
1576
1574
1577
1575
Output BOM results without `name` or `description`:
@@ -1618,7 +1616,7 @@ Output BOM results without `name` or `description`:
1618
1616
##### Example: Trim `properties` from only `components` path
1619
1617
1620
1618
```bash
1621
-
./sbom-utility trim -i test/trim/trim-cdx-1-5-sample-small-components-only.sbom.json --keys=properties --from components --quiet
1619
+
./sbom-utility trim -i test/trim/trim-cdx-1-5-sample-small-components-only.sbom.json --keys=properties --from components -q
1622
1620
```
1623
1621
1624
1622
Output BOM results with `properties` removed from all `components`:
@@ -2023,7 +2021,7 @@ The details include the full context of the failing `metadata.properties` object
2023
2021
The JSON format will provide an `array` of schema error results that can be post-processed as part of validation toolchain.
@@ -2576,16 +2574,16 @@ Simply append the flags `--args --trace` or `--args --debug` to your `go test` c
2576
2574
go test github.com/CycloneDX/sbom-utility/cmd -v --args --trace
2577
2575
```
2578
2576
2577
+
**Note**: You should always use the `--args` flag of `go test` as this will assure non-conflict with `go test` built-in flags which is the case with the `--trace` flag.
2578
+
2579
2579
#### Eliminating extraneous test output
2580
2580
2581
2581
Several tests will still output error and warning messages as designed. If these messages are distracting, you can turn them off using the `--quiet` flag.
2582
2582
2583
2583
```bash
2584
-
go test github.com/CycloneDX/sbom-utility/cmd -v --args --quiet
2584
+
go test github.com/CycloneDX/sbom-utility/cmd -v --quiet
2585
2585
```
2586
2586
2587
-
**Note**: Always use the `--args` flag of `go test` as this will assure non-conflict with built-in flags.
0 commit comments