From bb6cfaa7b10536850b28c42f62848ace71b1e576 Mon Sep 17 00:00:00 2001 From: Terry Howe Date: Mon, 30 Sep 2024 08:54:54 -0600 Subject: [PATCH] Update cmd/oras/internal/option/platform.go Co-authored-by: Billy Zha Signed-off-by: Terry Howe --- cmd/oras/internal/option/platform.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cmd/oras/internal/option/platform.go b/cmd/oras/internal/option/platform.go index 3a10b76c7..b44f0a1d9 100644 --- a/cmd/oras/internal/option/platform.go +++ b/cmd/oras/internal/option/platform.go @@ -81,10 +81,8 @@ type ArtifactPlatform struct { // ApplyFlags applies flags to a command flag set. func (opts *ArtifactPlatform) ApplyFlags(fs *pflag.FlagSet) { - if opts.FlagDescription == "" { - opts.FlagDescription = "artifact platform" - } - fs.StringVarP(&opts.platform, "artifact-platform", "", "", opts.FlagDescription+" in the form of `os[/arch][/variant][:os_version]`") + opts.FlagDescription = "set artifact platform" + opts.Platform.AppFlags(fs) } // Parse parses the input platform flag to an oci platform type.