Skip to content

Commit 17463c0

Browse files
fix: Expect at least one artifact in verification (#426)
* fix: Expect at least one artifact in verification Fixes #425 introduces by #419 Signed-off-by: Mihai Maruseac <[email protected]> * go fmt Signed-off-by: Mihai Maruseac <[email protected]> Signed-off-by: Mihai Maruseac <[email protected]>
1 parent e20f3cc commit 17463c0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cli/slsa-verifier/verify.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ func verifyArtifactCmd() *cobra.Command {
3232
o := &verify.VerifyOptions{}
3333

3434
cmd := &cobra.Command{
35-
Use: "verify-artifact [flags] artifact [artifact..]",
35+
Use: "verify-artifact [flags] artifact [artifact..]",
36+
Args: func(cmd *cobra.Command, args []string) error {
37+
if len(args) < 1 {
38+
return errors.New("expects at least one artifact")
39+
}
40+
return nil
41+
},
3642
Short: "Verifies SLSA provenance on artifact blobs given as arguments (assuming same provenance)",
3743
RunE: func(cmd *cobra.Command, args []string) error {
3844
v := verify.VerifyArtifactCommand{

0 commit comments

Comments
 (0)