MCPcopy Create free account
hub / github.com/avamsi/climate / newCommand

Function newCommand

command.go:27–40  ·  view source on GitHub ↗
(name string, md *internal.Metadata, params []internal.ParamType)

Source from the content-addressed store, hash-verified

25}
26
27func newCommand(name string, md *internal.Metadata, params []internal.ParamType) *command {
28 delegate := cobra.Command{
29 Use: md.Usage(name, params),
30 Aliases: md.Aliases(),
31 Short: md.Short(),
32 Long: md.Long(),
33 }
34 delegate.Flags().SortFlags = false
35 delegate.PersistentFlags().SortFlags = false
36 if md != nil {
37 delegate.DisableFlagsInUseLine = true
38 }
39 return &command{delegate}
40}
41
42func (cmd *command) addCommand(sub *command) {
43 cmd.delegate.AddCommand(&sub.delegate)

Callers 2

buildMethod · 0.85
buildMethod · 0.85

Calls 4

UsageMethod · 0.80
AliasesMethod · 0.80
ShortMethod · 0.80
LongMethod · 0.80

Tested by

no test coverage detected