From 47e99c4ed94c338975e94171dd9ef95a73b3c5d9 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.