diff --git a/cmd/oras/internal/option/common.go b/cmd/oras/internal/option/common.go index d5949584b..39e839ed4 100644 --- a/cmd/oras/internal/option/common.go +++ b/cmd/oras/internal/option/common.go @@ -30,9 +30,11 @@ const NoTTYFlag = "no-tty" type Common struct { Debug bool noTTY bool + // Verbose is deprecated. Use SuppressUntitled instead. // SuppressUntitled=false is equivalent to Verbose=true, while Verbose=false // no longer takes effect. + // TODO: remove from common Verbose bool TTY *os.File diff --git a/internal/descriptor/descriptor.go b/internal/descriptor/descriptor.go index aba1a7456..741aa3c94 100644 --- a/internal/descriptor/descriptor.go +++ b/internal/descriptor/descriptor.go @@ -69,10 +69,10 @@ func Plain(desc ocispec.Descriptor) ocispec.Descriptor { // GetName gets a descriptor name using either title or media type. func GetName(desc ocispec.Descriptor) string { title, ok := desc.Annotations[ocispec.AnnotationTitle] - if !ok { - return desc.MediaType + if ok { + return title } - return title + return desc.MediaType } // GenerateContentKey generates a unique key for each content descriptor using