Skip to content

Commit

Permalink
Remove invalid output file warning (#42)
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Rutkowski <[email protected]>
  • Loading branch information
mrutkows authored Jun 27, 2023
1 parent aafbf3c commit 27065e5
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 2,742 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ This example uses the `--format` flag on the `schema` command to output in markd
```md
|name|format|version|variant|file (local)|url (remote)|
|:--|:--|:--|:--|:--|:--|
|CycloneDX v1.5 (development)|CycloneDX|1.5|development|schema/cyclonedx/1.5/bom-1.5-dev.schema.json|https://raw.githubusercontent.com/CycloneDX/specification/v1.5-dev/schema/bom-1.5.schema.json|
|CycloneDX v1.5|CycloneDX|1.5|(latest)|schema/cyclonedx/1.5/bom-1.5.schema.json|https://raw.githubusercontent.com/CycloneDX/specification/master/schema/bom-1.5.schema.json|
|CycloneDX v1.4|CycloneDX|1.4|(latest)|schema/cyclonedx/1.4/bom-1.4.schema.json|https://raw.githubusercontent.com/CycloneDX/specification/master/schema/bom-1.4.schema.json|
|CycloneDX/specification/master/schema/bom-1.3-strict.schema.json|
|CycloneDX v1.3|CycloneDX|1.3|(latest)|schema/cyclonedx/1.3/bom-1.3.schema.json|https://raw.githubusercontent.com/CycloneDX/specification/master/schema/bom-1.3.schema.json|
Expand All @@ -203,7 +203,7 @@ This example shows the `--quiet` flag being used on the `schema` command to turn
```bash
name format version variant file (local) url (remote)
---- ------ ------- ------- ------------ ------------
CycloneDX v1.5 (development) CycloneDX 1.5 development schema/cyclonedx/1.5/bom-1.5-dev.schema.json https://raw.githubusercontent.com/CycloneDX/specification/v1.5-dev/schema/bom-1.5.schema.json
CycloneDX v1.5 CycloneDX 1.5 (latest) schema/cyclonedx/1.5/bom-1.5.schema.json https://raw.githubusercontent.com/CycloneDX/specification/master/schema/bom-1.5.schema.json
CycloneDX v1.4 CycloneDX 1.4 (latest) schema/cyclonedx/1.4/bom-1.4.schema.json https://raw.githubusercontent.com/CycloneDX/specification/master/schema/bom-1.4.schema.json
CycloneDX v1.3 CycloneDX 1.3 (latest) schema/cyclonedx/1.3/bom-1.3.schema.json https://raw.githubusercontent.com/CycloneDX/specification/master/schema/bom-1.3.schema.json
CycloneDX v1.2 CycloneDX 1.2 (latest) schema/cyclonedx/1.2/bom-1.2.schema.json https://raw.githubusercontent.com/CycloneDX/specification/master/schema/bom-1.2.schema.json
Expand All @@ -215,7 +215,7 @@ SPDX v2.2.1 SPDX SPDX-2.2 2.2.1 schema/spdx/2.2.

#### Output flag

All `list` subcommands support the `--output-file <filename>` flag (or its short-form `-o <filename>`) to send formatted output to a file.
All `list` subcommands and the `validate` command support the `--output-file <filename>` flag (or its short-form `-o <filename>`) to send formatted output to a file.

##### Example: `--output-file` flag

Expand Down
7 changes: 0 additions & 7 deletions cmd/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,6 @@ func NewCommandValidate() *cobra.Command {
command.Flags().StringVarP(&utils.GlobalFlags.PersistentFlags.OutputFormat, FLAG_FILE_OUTPUT_FORMAT, "", "",
MSG_VALIDATE_FLAG_ERR_FORMAT+VALIDATE_SUPPORTED_ERROR_FORMATS)
command.PreRunE = func(cmd *cobra.Command, args []string) error {

// This command can be called with this persistent flag, but does not make sense...
inputFile := utils.GlobalFlags.PersistentFlags.InputFile
if inputFile != "" {
getLogger().Warningf("Invalid flag for command: `%s` (`%s`). Ignoring...", FLAG_FILENAME_OUTPUT, FLAG_FILENAME_OUTPUT_SHORT)
}

return preRunTestForInputFile(cmd, args)
}
initCommandValidateFlags(command)
Expand Down
9 changes: 0 additions & 9 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,6 @@
"url": "https://raw.githubusercontent.com/CycloneDX/specification/master/schema/bom-1.4.schema.json",
"default": true
},
{
"version": "1.5",
"variant": "development",
"name": "CycloneDX v1.5 (development)",
"file": "schema/cyclonedx/1.5/bom-1.5-dev.schema.json",
"development": "https://github.com/CycloneDX/specification/blob/v1.5-dev/schema/bom-1.5.schema.json",
"url": "https://raw.githubusercontent.com/CycloneDX/specification/v1.5-dev/schema/bom-1.5.schema.json",
"default": false
},
{
"version": "1.5",
"variant": "",
Expand Down
Loading

0 comments on commit 27065e5

Please sign in to comment.