NewRunner returns a command runner.
(parent string)
| 26 | |
| 27 | // NewRunner returns a command runner. |
| 28 | func 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 | |
| 48 | func NewSetCommand(parent string) *cobra.Command { |
| 49 | return NewSetRunner(parent).Command |
no test coverage detected