Skip to content
Merged
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
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ Scan a given SBOM for EOL data
```
USAGE
$ hd scan eol [--json] [-f <value> | -d <value>] [-s] [-o <value>] [--saveSbom] [--sbomOutput <value>]
[--saveTrimmedSbom] [--hideReportUrl] [--automated] [--version]
[--saveTrimmedSbom] [--hideReportUrl] [--automated]

FLAGS
-d, --dir=<value> [default: <current directory>] The directory to scan in order to create a cyclonedx SBOM
Expand All @@ -210,7 +210,6 @@ FLAGS
--saveSbom Save the generated SBOM as herodevs.sbom.json in the scanned directory
--saveTrimmedSbom Save the trimmed SBOM as herodevs.sbom-trimmed.json in the scanned directory
--sbomOutput=<value> Save the generated SBOM to a custom path (defaults to herodevs.sbom.json when not provided)
--version Show CLI version.

GLOBAL FLAGS
--json Format output as json.
Expand Down
9 changes: 6 additions & 3 deletions bin/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ import { parseArgs } from 'node:util';
import { execute } from '@oclif/core';

async function main(isProduction = false) {
const { positionals } = parseArgs({
const { positionals, values } = parseArgs({
allowPositionals: true,
strict: false, // Don't validate flags
options: {
version: { type: 'boolean', short: 'v' },
},
});

// If no arguments at all, default to help
if (positionals.length === 0) {
// If no arguments at all, default to help (but not if --version/-v was passed)
if (positionals.length === 0 && !values.version) {
process.argv.splice(2, 0, 'help');
}

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
"license": "MIT",
"main": "dist/index.js",
"oclif": {
"additionalVersionFlags": ["-v"],
"bin": "hd",
"dirname": "hd",
"commands": "./dist/commands",
Expand Down