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

Function NewRunner

internal/cmdsync/cmdsync.go:26–47  ·  view source on GitHub ↗

NewRunner returns a command runner.

(parent string)

Source from the content-addressed store, hash-verified

24
25// NewRunner returns a command runner.
26func NewRunner(parent string) *Runner {
27 r := &Runner{}
28 c := &cobra.Command{
29 Use: "sync LOCAL_PKG_DIR",
30 Short: docs.SyncShort,
31 Long: docs.SyncLong,
32 Example: docs.SyncExamples,
33 RunE: r.runE,
34 Args: cobra.ExactArgs(1),
35 PreRunE: r.preRunE,
36 }
37
38 c.Flags().BoolVar(&r.Sync.Verbose, "verbose", false,
39 "print verbose logging information.")
40 c.Flags().BoolVar(&r.Sync.DryRun, "dry-run", false,
41 "print sync actions without performing them.")
42 cmdutil.FixDocs("kpt", parent, c)
43 r.Command = c
44
45 c.AddCommand(NewSetCommand(parent))
46 return r
47}
48
49func NewCommand(parent string) *cobra.Command {
50 return NewRunner(parent).Command

Callers 1

NewCommandFunction · 0.70

Calls 2

FixDocsFunction · 0.92
NewSetCommandFunction · 0.85

Tested by

no test coverage detected