Skip to content

Commit

Permalink
refactor: reuse print status func (#507)
Browse files Browse the repository at this point in the history
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
  • Loading branch information
qweeah authored Aug 18, 2022
1 parent 3fc3415 commit a5aa136
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions cmd/oras/internal/display/print.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,7 @@ func Print(a ...any) error {
// StatusPrinter returns a tracking function for transfer status.
func StatusPrinter(status string, verbose bool) func(context.Context, ocispec.Descriptor) error {
return func(ctx context.Context, desc ocispec.Descriptor) error {
name, ok := desc.Annotations[ocispec.AnnotationTitle]
if !ok {
if !verbose {
return nil
}
name = desc.MediaType
}
return Print(status, ShortDigest(desc), name)
return PrintStatus(desc, status, verbose)
}
}

Expand Down

0 comments on commit a5aa136

Please sign in to comment.