MCPcopy Create free account
hub / github.com/docker/compose / commandParameters

Function commandParameters

docs/examples/provider.go:136–149  ·  view source on GitHub ↗
(cmd *cobra.Command)

Source from the content-addressed store, hash-verified

134}
135
136func commandParameters(cmd *cobra.Command) CommandMetadata {
137 cmdMetadata := CommandMetadata{}
138 cmd.Flags().VisitAll(func(f *pflag.Flag) {
139 _, isRequired := f.Annotations[cobra.BashCompOneRequiredFlag]
140 cmdMetadata.Parameters = append(cmdMetadata.Parameters, Metadata{
141 Name: f.Name,
142 Description: f.Usage,
143 Required: isRequired,
144 Type: f.Value.Type(),
145 Default: f.DefValue,
146 })
147 })
148 return cmdMetadata
149}
150
151type ProviderMetadata struct {
152 Description string `json:"description"`

Callers 1

metadataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected