MCPcopy
hub / github.com/kptdev/kpt / GetPkgCommand

Function GetPkgCommand

commands/pkgcmd.go:29–52  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

27)
28
29func GetPkgCommand(name string) *cobra.Command {
30 pkg := &cobra.Command{
31 Use: "pkg",
32 Short: pkgdocs.PkgShort,
33 Long: pkgdocs.PkgLong,
34 Example: pkgdocs.PkgExamples,
35 Aliases: []string{"package"},
36 RunE: func(cmd *cobra.Command, args []string) error {
37 h, err := cmd.Flags().GetBool("help")
38 if err != nil {
39 return err
40 }
41 if h {
42 return cmd.Help()
43 }
44 return cmd.Usage()
45 },
46 }
47 pkg.AddCommand(
48 cmddesc.NewCommand(name), cmdget.NewCommand(name), cmdinit.NewCommand(name),
49 cmdfix.NewCommand(name), cmdsync.NewCommand(name), cmdupdate.NewCommand(name), cmddiff.NewCommand(name),
50 )
51 return pkg
52}

Callers 1

GetKptCommandsFunction · 0.85

Calls 7

NewCommandFunction · 0.92
NewCommandFunction · 0.92
NewCommandFunction · 0.92
NewCommandFunction · 0.92
NewCommandFunction · 0.92
NewCommandFunction · 0.92
NewCommandFunction · 0.92

Tested by

no test coverage detected