Merge pull request #3862 from deitch/canonical-tag

option to show canonical tag
This commit is contained in:
Avi Deitcher 2022-11-07 09:53:50 +02:00 committed by GitHub
commit 121002bae4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,6 +18,7 @@ func pkgShowTag(args []string) {
fmt.Fprintf(os.Stderr, "\n")
flags.PrintDefaults()
}
canonical := flags.Bool("canonical", false, "Show canonical name, e.g. docker.io/linuxkit/foo:1234, instead of the default, e.g. linuxkit/foo:1234")
pkgs, err := pkglib.NewFromCLI(flags, args...)
if err != nil {
@ -25,6 +26,10 @@ func pkgShowTag(args []string) {
os.Exit(1)
}
for _, p := range pkgs {
fmt.Println(p.Tag())
tag := p.Tag()
if *canonical {
tag = p.FullTag()
}
fmt.Println(tag)
}
}