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.