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

Function NewSetRunner

internal/cmdsync/cmdsyncset.go:28–46  ·  view source on GitHub ↗

NewRunner returns a command runner.

(parent string)

Source from the content-addressed store, hash-verified

26
27// NewRunner returns a command runner.
28func NewSetRunner(parent string) *SetRunner {
29 r := &SetRunner{}
30 c := &cobra.Command{
31 Use: "set REPO_URI[.git]/PKG_PATH[@VERSION] LOCAL_DEST_DIRECTORY",
32 RunE: r.runE,
33 Long: docs.SetLong,
34 Short: docs.SetShort,
35 Example: docs.SetExamples,
36 Args: cobra.ExactArgs(2),
37 PreRunE: r.preRunE,
38 }
39
40 c.Flags().StringVar(&r.Dependency.Strategy, "strategy", "", "update strategy to use.")
41 c.Flags().BoolVar(&r.Dependency.EnsureNotExists, "prune", false,
42 "prune the dependency when it is synced.")
43 cmdutil.FixDocs("kpt", parent, c)
44 r.Command = c
45 return r
46}
47
48func NewSetCommand(parent string) *cobra.Command {
49 return NewSetRunner(parent).Command

Callers 1

NewSetCommandFunction · 0.85

Calls 1

FixDocsFunction · 0.92

Tested by

no test coverage detected