Skip to content

Commit 400a3f6

Browse files
committed
refactor: use new helper elsewhere
1 parent 822ead3 commit 400a3f6

2 files changed

Lines changed: 2 additions & 10 deletions

File tree

cmd/osv-scanner/scan/image/command.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,7 @@ func action(_ context.Context, cmd *cli.Command, stdout, stderr io.Writer, clien
4949
}
5050

5151
format := cmd.String("format")
52-
outputPath := cmd.String("output-file")
53-
54-
if outputPath == "" {
55-
outputPath = cmd.String("output")
56-
}
52+
outputPath := cmd.String(helper.FallbackToDeprecatedName(cmd, "output-file", "output"))
5753
serve := cmd.Bool("serve")
5854
if serve {
5955
format = "html"

cmd/osv-scanner/scan/source/command.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,7 @@ func Command(stdout, stderr io.Writer, client *http.Client) *cli.Command {
9797
func action(_ context.Context, cmd *cli.Command, stdout, stderr io.Writer, client *http.Client) error {
9898
format := cmd.String("format")
9999

100-
outputPath := cmd.String("output-file")
101-
102-
if outputPath == "" {
103-
outputPath = cmd.String("output")
104-
}
100+
outputPath := cmd.String(helper.FallbackToDeprecatedName(cmd, "output-file", "output"))
105101
serve := cmd.Bool("serve")
106102
if serve {
107103
format = "html"

0 commit comments

Comments
 (0)