NewPrintCmd creates a new devspace print command
(f factory.Factory, globalFlags *flags.GlobalFlags)
| 39 | |
| 40 | // NewPrintCmd creates a new devspace print command |
| 41 | func NewPrintCmd(f factory.Factory, globalFlags *flags.GlobalFlags) *cobra.Command { |
| 42 | cmd := &PrintCmd{ |
| 43 | GlobalFlags: globalFlags, |
| 44 | StripNames: true, |
| 45 | Out: os.Stdout, |
| 46 | } |
| 47 | |
| 48 | printCmd := &cobra.Command{ |
| 49 | Use: "print", |
| 50 | Short: "Prints displays the configuration", |
| 51 | Long: ` |
| 52 | ####################################################### |
| 53 | ################## devspace print ##################### |
| 54 | ####################################################### |
| 55 | Prints the configuration for the current or given |
| 56 | profile after all patching and variable substitution |
| 57 | #######################################################`, |
| 58 | RunE: func(cobraCmd *cobra.Command, args []string) error { |
| 59 | plugin.SetPluginCommand(cobraCmd, args) |
| 60 | return cmd.Run(f) |
| 61 | }, |
| 62 | } |
| 63 | |
| 64 | printCmd.Flags().BoolVar(&cmd.SkipInfo, "skip-info", false, "When enabled, only prints the configuration without additional information") |
| 65 | printCmd.Flags().StringVar(&cmd.Dependency, "dependency", "", "The dependency to print the config from. Use dot to access nested dependencies (e.g. dep1.dep2)") |
| 66 | |
| 67 | return printCmd |
| 68 | } |
| 69 | |
| 70 | // Run executes the command logic |
| 71 | func (cmd *PrintCmd) Run(f factory.Factory) error { |
no test coverage detected