Skip to content

Commit

Permalink
revisit option descriptions
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
  • Loading branch information
jkowalleck committed Mar 8, 2024
1 parent b85dde9 commit 1ebac1d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 36 deletions.
21 changes: 7 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,13 @@ $ yarn CycloneDX make-sbom
━━━ Options ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
--spec-version #0 Which version of CycloneDX to use.
(choices: "1.2", "1.3", "1.4", "1.5", default: "1.5")
--output-format #0 Which output format to use.
(choices: "JSON", "XML", default: "JSON")
--output-file #0 Path to the output file. Set to "-" to write to STDOUT.
(default: write to STDOUT)
--production,--prod Exclude development dependencies.
(defaults to 'true' if the environment variable "NODE_ENV" is set to "production"')
--component-type #0 Type of component described by the generated SBOM. (choices: "application", "framework", "library", "container", "platform", "device-driver")
Default: application
--licenses Include license information for components in generated SBOM. License information will always be absent for components that don't specify licenses unambigously.
Default: Licenses are not included in the SBOM.
--reproducible Omit anything random or time-based from SBOM. If enabled consecutive runs of will result in identical files.
Default: false
--spec-version #0 Which version of CycloneDX to use. (choices: "1.2", "1.3", "1.4", "1.5", default: "1.5")
--output-format #0 Which output format to use. (choices: "JSON", "XML", default: "JSON")
--output-file #0 Path to the output file. Set to "-" to write to STDOUT (default: write to STDOUT)
--production,--prod Exclude development dependencies. (default: true if the NODE_ENV environment variable is set to "production", otherwise false)
--mc-type #0 Type of the main component. (choices: "application", "framework", "library", "container", "platform", "device-driver", default: "application")
--licenses Include license information for components in generated SBOM. License information will always be absent for components that don't specify licenses unambiguously.
--reproducible Whether to go the extra mile and make the output reproducible. This might result in loss of time- and random-based values.
━━━ Details ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Expand Down
30 changes: 8 additions & 22 deletions sources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,49 +44,35 @@ class SBOMCommand extends BaseCommand {
});

specVersion = Option.String("--spec-version", {
description: `Which version of CycloneDX to use.
(choices: "1.2", "1.3", "1.4", "1.5", default: "1.5")`,
description: 'Which version of CycloneDX to use.\n(choices: "1.2", "1.3", "1.4", "1.5", default: "1.5")',
});

outputFormat = Option.String("--output-format", {
description: `Which output format to use.
(choices: "JSON", "XML", default: "JSON")`,
description: 'Which output format to use.\n(choices: "JSON", "XML", default: "JSON")',
});

outputFile = Option.String(`--output-file`, {
description: `Path to the output file. Set to "-" to write to STDOUT.
(default: write to STDOUT)`,
description: `Path to the output file.\nSet to "-" to write to STDOUT\n(default: write to STDOUT)`,
});

/* mimic option from yarn.
- see https://classic.yarnpkg.com/lang/en/docs/cli/install/#toc-yarn-install-production-true-false
- see https://yarnpkg.com/cli/workspaces/focus
*/
production = Option.Boolean(`--production,--prod`, process.env.NODE_ENV=='production', {
description: `Exclude development dependencies.
(defaults to 'true' if the environment variable "NODE_ENV" is set to "production"')`,
description: 'Exclude development dependencies.\n(default: true if the NODE_ENV environment variable is set to "production", otherwise false)',
});

componentType = Option.String("--component-type", {
description: `Type of component described by the generated SBOM. (choices: "application", "framework", "library", "container", "platform", "device-driver")
Default: application`,
componentType = Option.String("--mc-type", {
description: 'Type of the main component.\n(choices: "application", "framework", "library", "container", "platform", "device-driver", default: "application")',
});

licenses = Option.Boolean(`--licenses`, false, {
description: `Include license information for components in generated SBOM. License information will always be absent for components that don't specify licenses unambigously.
Default: Licenses are not included in the SBOM.`,
description: `Include license information for components in generated SBOM.\nLicense information will always be absent for components that don't specify licenses unambiguously.`,
});

reproducible = Option.Boolean(`--reproducible`, false, {
description: `Omit anything random or time-based from SBOM. If enabled consecutive runs of will result in identical files.
Default: false`,
description: 'Whether to go the extra mile and make the output reproducible.\nThis might result in loss of time- and random-based values.',
});

async execute() {
Expand Down

0 comments on commit 1ebac1d

Please sign in to comment.