MCPcopy Index your code
hub / github.com/devspace-sh/devspace / NewPrintCmd

Function NewPrintCmd

cmd/print.go:41–68  ·  view source on GitHub ↗

NewPrintCmd creates a new devspace print command

(f factory.Factory, globalFlags *flags.GlobalFlags)

Source from the content-addressed store, hash-verified

39
40// NewPrintCmd creates a new devspace print command
41func 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#######################################################
55Prints the configuration for the current or given
56profile 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
71func (cmd *PrintCmd) Run(f factory.Factory) error {

Callers 1

BuildRootFunction · 0.85

Calls 2

RunMethod · 0.95
SetPluginCommandFunction · 0.92

Tested by

no test coverage detected