From f0a1e2707c8aa22848797c8cb276d936ffac7fad Mon Sep 17 00:00:00 2001 From: Zach Steindler Date: Wed, 10 Apr 2024 10:11:33 -0400 Subject: [PATCH] Change subcommands default to be more user friendly Signed-off-by: Zach Steindler --- pkg/cmd/attestation/download/download.go | 2 +- pkg/cmd/attestation/verify/verify.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/attestation/download/download.go b/pkg/cmd/attestation/download/download.go index ebc884590..7154a6edd 100644 --- a/pkg/cmd/attestation/download/download.go +++ b/pkg/cmd/attestation/download/download.go @@ -20,7 +20,7 @@ func NewDownloadCmd(f *cmdutil.Factory, runF func(*Options) error) *cobra.Comman opts := &Options{} downloadCmd := &cobra.Command{ Use: "download [ | oci://] [--owner | --repo]", - Args: cobra.ExactArgs(1), + Args: cmdutil.MinimumArgs(1, "must specify file path or container image URI, as well as one of --owner or --repo"), Short: "Download an artifact's Sigstore bundle(s) for offline use", Long: heredoc.Docf(` Download an artifact's attestations, aka Sigstore bundle(s), for offline use. diff --git a/pkg/cmd/attestation/verify/verify.go b/pkg/cmd/attestation/verify/verify.go index d8b93dd3f..ef5f8ef75 100644 --- a/pkg/cmd/attestation/verify/verify.go +++ b/pkg/cmd/attestation/verify/verify.go @@ -20,7 +20,7 @@ func NewVerifyCmd(f *cmdutil.Factory, runF func(*Options) error) *cobra.Command opts := &Options{} verifyCmd := &cobra.Command{ Use: "verify [ | oci://] [--owner | --repo]", - Args: cobra.ExactArgs(1), + Args: cmdutil.MinimumArgs(1, "must specify file path or container image URI, as well as one of --owner or --repo"), Short: "Verify an artifact's integrity using attestations", Long: heredoc.Docf(` Verify the integrity and provenance of an artifact using its associated