File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -197,7 +197,7 @@ Scan a given SBOM for EOL data
197197```
198198USAGE
199199 $ hd scan eol [--json] [-f <value> | -d <value>] [-s] [-o <value>] [--saveSbom] [--sbomOutput <value>]
200- [--saveTrimmedSbom] [--hideReportUrl] [--automated] [--version]
200+ [--saveTrimmedSbom] [--hideReportUrl] [--automated]
201201
202202FLAGS
203203 -d, --dir=<value> [default: <current directory>] The directory to scan in order to create a cyclonedx SBOM
@@ -210,7 +210,6 @@ FLAGS
210210 --saveSbom Save the generated SBOM as herodevs.sbom.json in the scanned directory
211211 --saveTrimmedSbom Save the trimmed SBOM as herodevs.sbom-trimmed.json in the scanned directory
212212 --sbomOutput=<value> Save the generated SBOM to a custom path (defaults to herodevs.sbom.json when not provided)
213- --version Show CLI version.
214213
215214GLOBAL FLAGS
216215 --json Format output as json.
Original file line number Diff line number Diff line change @@ -2,13 +2,16 @@ import { parseArgs } from 'node:util';
22import { execute } from '@oclif/core' ;
33
44async function main ( isProduction = false ) {
5- const { positionals } = parseArgs ( {
5+ const { positionals, values } = parseArgs ( {
66 allowPositionals : true ,
77 strict : false , // Don't validate flags
8+ options : {
9+ version : { type : 'boolean' , short : 'v' } ,
10+ } ,
811 } ) ;
912
10- // If no arguments at all, default to help
11- if ( positionals . length === 0 ) {
13+ // If no arguments at all, default to help (but not if --version/-v was passed)
14+ if ( positionals . length === 0 && ! values . version ) {
1215 process . argv . splice ( 2 , 0 , 'help' ) ;
1316 }
1417
Original file line number Diff line number Diff line change 9797 "license" : " MIT" ,
9898 "main" : " dist/index.js" ,
9999 "oclif" : {
100+ "additionalVersionFlags" : [" -v" ],
100101 "bin" : " hd" ,
101102 "dirname" : " hd" ,
102103 "commands" : " ./dist/commands" ,
You can’t perform that action at this time.
0 commit comments