remove quiet and verbose flags

Signed-off-by: Meredith Lancaster <malancas@github.com>
This commit is contained in:
Meredith Lancaster 2024-03-14 22:42:21 -06:00
parent 007d368681
commit af75fe875c
8 changed files with 0 additions and 42 deletions

View file

@ -102,7 +102,6 @@ func NewDownloadCmd(f *cmdutil.Factory, runF func(*Options) error) *cobra.Comman
downloadCmd.MarkFlagsOneRequired("owner", "repo")
cmdutil.StringEnumFlag(downloadCmd, &opts.DigestAlgorithm, "digest-alg", "d", "sha256", []string{"sha256", "sha512"}, "The algorithm used to compute a digest of the artifact")
downloadCmd.Flags().IntVarP(&opts.Limit, "limit", "L", api.DefaultLimit, "Maximum number of attestations to fetch")
downloadCmd.Flags().BoolVarP(&opts.Verbose, "verbose", "v", false, "If set to true, the CLI will output verbose information.")
return downloadCmd
}

View file

@ -23,7 +23,6 @@ type Options struct {
OCIClient oci.Client
Owner string
Repo string
Verbose bool
}
func (opts *Options) AreFlagsValid() error {

View file

@ -85,9 +85,6 @@ func NewInspectCmd(f *cmdutil.Factory, runF func(*Options) error) *cobra.Command
inspectCmd.MarkFlagRequired("bundle") //nolint:errcheck
cmdutil.StringEnumFlag(inspectCmd, &opts.DigestAlgorithm, "digest-alg", "d", "sha256", []string{"sha256", "sha512"}, "The algorithm used to compute a digest of the artifact")
inspectCmd.Flags().BoolVarP(&opts.JsonResult, "json-result", "j", false, "Output inspect result as JSON lines")
inspectCmd.Flags().BoolVarP(&opts.Quiet, "quiet", "q", false, "If set to true, the CLI will not print any diagnostic logging.")
inspectCmd.Flags().BoolVarP(&opts.Verbose, "verbose", "v", false, "If set to true, the CLI will print verbose diagnostic logging.")
inspectCmd.MarkFlagsMutuallyExclusive("quiet", "verbose")
return inspectCmd
}

View file

@ -89,19 +89,6 @@ func TestNewInspectCmd(t *testing.T) {
},
wantsErr: true,
},
{
name: "Has both verbose and quiet flags",
cli: "../test/data/sigstore-js-2.1.0.tgz --bundle ../test/data/sigstore-js-2.1.0-bundle.json --verbose --quiet",
wants: Options{
ArtifactPath: "../test/data/sigstore-js-2.1.0.tgz",
BundlePath: "../test/data/sigstore-js-2.1.0-bundle.json",
DigestAlgorithm: "sha256",
OCIClient: oci.MockClient{},
Verbose: true,
Quiet: true,
},
wantsErr: true,
},
}
for _, tc := range testcases {
@ -129,8 +116,6 @@ func TestNewInspectCmd(t *testing.T) {
assert.Equal(t, tc.wants.BundlePath, opts.BundlePath)
assert.Equal(t, tc.wants.DigestAlgorithm, opts.DigestAlgorithm)
assert.Equal(t, tc.wants.JsonResult, opts.JsonResult)
assert.Equal(t, tc.wants.Verbose, opts.Verbose)
assert.Equal(t, tc.wants.Quiet, opts.Quiet)
})
}
}

View file

@ -13,8 +13,6 @@ type Options struct {
BundlePath string
DigestAlgorithm string
JsonResult bool
Verbose bool
Quiet bool
Logger *io.Handler
OCIClient oci.Client
}

View file

@ -21,11 +21,9 @@ type Options struct {
NoPublicGood bool
OIDCIssuer string
Owner string
Quiet bool
Repo string
SAN string
SANRegex string
Verbose bool
APIClient api.Client
Logger *io.Handler
Limit int

View file

@ -121,9 +121,6 @@ func NewVerifyCmd(f *cmdutil.Factory, runF func(*Options) error) *cobra.Command
verifyCmd.MarkFlagsOneRequired("owner", "repo")
verifyCmd.Flags().BoolVarP(&opts.NoPublicGood, "no-public-good", "", false, "Only verify attestations signed with GitHub's Sigstore instance")
verifyCmd.Flags().BoolVarP(&opts.JsonResult, "json-result", "j", false, "Output verification result as JSON lines")
verifyCmd.Flags().BoolVarP(&opts.Quiet, "quiet", "q", false, "If set to true, the CLI will not print any diagnostic logging.")
verifyCmd.Flags().BoolVarP(&opts.Verbose, "verbose", "v", false, "If set to true, the CLI will print verbose diagnostic logging.")
verifyCmd.MarkFlagsMutuallyExclusive("quiet", "verbose")
verifyCmd.Flags().StringVarP(&opts.CustomTrustedRoot, "custom-trusted-root", "", "", "Path to a custom trustedroot.json file to use for verification")
verifyCmd.Flags().IntVarP(&opts.Limit, "limit", "L", api.DefaultLimit, "Maximum number of attestations to fetch")
// policy enforcement flags

View file

@ -152,19 +152,6 @@ func TestNewVerifyCmd(t *testing.T) {
},
wantsErr: true,
},
{
name: "Has both verbose and quiet flags",
cli: "../test/data/sigstore-js-2.1.0.tgz --bundle ../test/data/sigstore-js-2.1.0-bundle.json --owner sigstore --verbose --quiet",
wants: Options{
ArtifactPath: "../test/data/sigstore-js-2.1.0.tgz",
BundlePath: "../test/data/sigstore-js-2.1.0-bundle.json",
DigestAlgorithm: "sha256",
OIDCIssuer: GitHubOIDCIssuer,
Verbose: true,
Quiet: true,
},
wantsErr: true,
},
{
name: "Has both cert-identity and cert-identity-regex flags",
cli: "../test/data/sigstore-js-2.1.0.tgz --owner sigstore --cert-identity https://github.com/sigstore/ --cert-identity-regex ^https://github.com/sigstore/",
@ -212,11 +199,9 @@ func TestNewVerifyCmd(t *testing.T) {
assert.Equal(t, tc.wants.NoPublicGood, opts.NoPublicGood)
assert.Equal(t, tc.wants.OIDCIssuer, opts.OIDCIssuer)
assert.Equal(t, tc.wants.Owner, opts.Owner)
assert.Equal(t, tc.wants.Quiet, opts.Quiet)
assert.Equal(t, tc.wants.Repo, opts.Repo)
assert.Equal(t, tc.wants.SAN, opts.SAN)
assert.Equal(t, tc.wants.SANRegex, opts.SANRegex)
assert.Equal(t, tc.wants.Verbose, opts.Verbose)
})
}
}