diff --git a/cmd/oras/root/attach.go b/cmd/oras/root/attach.go index 1531927d5..c0e00f229 100644 --- a/cmd/oras/root/attach.go +++ b/cmd/oras/root/attach.go @@ -42,6 +42,9 @@ type attachOptions struct { option.Format option.Platform + // Verbose is deprecated. The default behavior is now equivalent to + // Verbose=true, while Verbose=false no longer takes effect. + Verbose bool artifactType string concurrency int } @@ -113,9 +116,12 @@ Example - Attach file to the manifest tagged 'v1' in an OCI image layout folder }, } + opts.FlagDescription = "[Preview] attach to an arch-specific subject" cmd.Flags().StringVarP(&opts.artifactType, "artifact-type", "", "", "artifact type") cmd.Flags().IntVarP(&opts.concurrency, "concurrency", "", 5, "concurrency level") - opts.FlagDescription = "[Preview] attach to an arch-specific subject" + cmd.Flags().BoolVarP(&opts.Verbose, "verbose", "v", false, "[Deprecated] verbose output") + + _ = cmd.Flags().MarkDeprecated("verbose", "and may be removed in a future release.") _ = cmd.MarkFlagRequired("artifact-type") opts.EnableDistributionSpecFlag() opts.SetTypes(option.FormatTypeText, option.FormatTypeJSON, option.FormatTypeGoTemplate) diff --git a/cmd/oras/root/blob/push.go b/cmd/oras/root/blob/push.go index b4828a634..bd255d260 100644 --- a/cmd/oras/root/blob/push.go +++ b/cmd/oras/root/blob/push.go @@ -39,6 +39,9 @@ type pushBlobOptions struct { option.Pretty option.Target + // Verbose is deprecated. The default behavior is now equivalent to + // Verbose=true, while Verbose=false no longer takes effect. + Verbose bool fileRef string mediaType string size int64 @@ -96,6 +99,9 @@ Example - Push blob 'hi.txt' into an OCI image layout folder 'layout-dir': cmd.Flags().Int64VarP(&opts.size, "size", "", -1, "provide the blob size") cmd.Flags().StringVarP(&opts.mediaType, "media-type", "", ocispec.MediaTypeImageLayer, "specify the returned media type in the descriptor if --descriptor is used") + cmd.Flags().BoolVarP(&opts.Verbose, "verbose", "v", false, "[Deprecated] verbose output") + _ = cmd.Flags().MarkDeprecated("verbose", "and may be removed in a future release.") + option.ApplyFlags(&opts, cmd.Flags()) return oerrors.Command(cmd, &opts.Target) } diff --git a/cmd/oras/root/cp.go b/cmd/oras/root/cp.go index 8cf5ac250..63b45c0c0 100644 --- a/cmd/oras/root/cp.go +++ b/cmd/oras/root/cp.go @@ -50,6 +50,9 @@ type copyOptions struct { option.Platform option.BinaryTarget + // Verbose is deprecated. The default behavior is now equivalent to + // Verbose=true, while Verbose=false no longer takes effect. + Verbose bool recursive bool concurrency int extraRefs []string @@ -105,6 +108,9 @@ Example - Copy an artifact with multiple tags with concurrency tuned: } cmd.Flags().BoolVarP(&opts.recursive, "recursive", "r", false, "[Preview] recursively copy the artifact and its referrer artifacts") cmd.Flags().IntVarP(&opts.concurrency, "concurrency", "", 3, "concurrency level") + cmd.Flags().BoolVarP(&opts.Verbose, "verbose", "v", false, "[Deprecated] verbose output") + _ = cmd.Flags().MarkDeprecated("verbose", "and may be removed in a future release.") + opts.EnableDistributionSpecFlag() option.ApplyFlags(&opts, cmd.Flags()) return oerrors.Command(cmd, &opts.BinaryTarget) diff --git a/cmd/oras/root/discover.go b/cmd/oras/root/discover.go index 34d3bccb0..ab66447de 100644 --- a/cmd/oras/root/discover.go +++ b/cmd/oras/root/discover.go @@ -38,6 +38,7 @@ type discoverOptions struct { option.Platform option.Target option.Format + Verbose bool artifactType string } @@ -101,6 +102,7 @@ Example - Discover referrers of the manifest tagged 'v1' in an OCI image layout cmd.Flags().StringVarP(&opts.artifactType, "artifact-type", "", "", "artifact type") cmd.Flags().StringVarP(&opts.Format.FormatFlag, "output", "o", "tree", "[Deprecated] format in which to display referrers (table, json, or tree). tree format will also show indirect referrers") + cmd.Flags().BoolVarP(&opts.Verbose, "verbose", "v", false, "display full metadata of referrers") opts.SetTypes( option.FormatTypeTree, option.FormatTypeTable, diff --git a/cmd/oras/root/manifest/push.go b/cmd/oras/root/manifest/push.go index 24e1480c6..27000c425 100644 --- a/cmd/oras/root/manifest/push.go +++ b/cmd/oras/root/manifest/push.go @@ -44,6 +44,9 @@ type pushOptions struct { option.Pretty option.Target + // Verbose is deprecated. The default behavior is now equivalent to + // Verbose=true, while Verbose=false no longer takes effect. + Verbose bool concurrency int extraRefs []string fileRef string @@ -107,6 +110,9 @@ Example - Push a manifest to an OCI image layout folder 'layout-dir' and tag wit option.ApplyFlags(&opts, cmd.Flags()) cmd.Flags().StringVarP(&opts.mediaType, "media-type", "", "", "media type of manifest") cmd.Flags().IntVarP(&opts.concurrency, "concurrency", "", 5, "concurrency level") + cmd.Flags().BoolVarP(&opts.Verbose, "verbose", "v", false, "[Deprecated] verbose output") + _ = cmd.Flags().MarkDeprecated("verbose", "and may be removed in a future release.") + return oerrors.Command(cmd, &opts.Target) } diff --git a/cmd/oras/root/pull.go b/cmd/oras/root/pull.go index 6ab3a3dff..e267a97b4 100644 --- a/cmd/oras/root/pull.go +++ b/cmd/oras/root/pull.go @@ -52,6 +52,9 @@ type pullOptions struct { PathTraversal bool Output string ManifestConfigRef string + // Verbose is deprecated. The default behavior is now equivalent to + // Verbose=true, while Verbose=false no longer takes effect. + Verbose bool } func pullCmd() *cobra.Command { @@ -111,6 +114,9 @@ Example - Pull artifact files from an OCI layout archive 'layout.tar': cmd.Flags().StringVarP(&opts.Output, "output", "o", ".", "output directory") cmd.Flags().StringVarP(&opts.ManifestConfigRef, "config", "", "", "output manifest config file") cmd.Flags().IntVarP(&opts.concurrency, "concurrency", "", 3, "concurrency level") + cmd.Flags().BoolVarP(&opts.Verbose, "verbose", "v", false, "[Deprecated] verbose output") + _ = cmd.Flags().MarkDeprecated("verbose", "and may be removed in a future release.") + opts.SetTypes(option.FormatTypeText, option.FormatTypeJSON, option.FormatTypeGoTemplate) option.ApplyFlags(&opts, cmd.Flags()) return oerrors.Command(cmd, &opts.Target) diff --git a/cmd/oras/root/push.go b/cmd/oras/root/push.go index b5ae07e14..f21493e5d 100644 --- a/cmd/oras/root/push.go +++ b/cmd/oras/root/push.go @@ -47,6 +47,9 @@ type pushOptions struct { option.ImageSpec option.Target option.Format + // Verbose is deprecated. The default behavior is now equivalent to + // Verbose=true, while Verbose=false no longer takes effect. + Verbose bool extraRefs []string manifestConfigRef string @@ -163,6 +166,9 @@ Example - Push file "hi.txt" into an OCI image layout folder 'layout-dir' with t cmd.Flags().StringVarP(&opts.manifestConfigRef, "config", "", "", "`path` of image config file") cmd.Flags().StringVarP(&opts.artifactType, "artifact-type", "", "", "artifact type") cmd.Flags().IntVarP(&opts.concurrency, "concurrency", "", 5, "concurrency level") + cmd.Flags().BoolVarP(&opts.Verbose, "verbose", "v", false, "[Deprecated] verbose output") + _ = cmd.Flags().MarkDeprecated("verbose", "and may be removed in a future release.") + opts.SetTypes(option.FormatTypeText, option.FormatTypeJSON, option.FormatTypeGoTemplate) option.ApplyFlags(&opts, cmd.Flags()) return oerrors.Command(cmd, &opts.Target)