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

Function NewOpenCmd

cmd/open.go:61–91  ·  view source on GitHub ↗

NewOpenCmd creates a new open command

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

Source from the content-addressed store, hash-verified

59
60// NewOpenCmd creates a new open command
61func NewOpenCmd(f factory.Factory, globalFlags *flags.GlobalFlags) *cobra.Command {
62 cmd := &OpenCmd{
63 GlobalFlags: globalFlags,
64 log: log.GetInstance(),
65 }
66
67 openCmd := &cobra.Command{
68 Use: "open",
69 Short: "Opens the space in the browser",
70 Long: `
71#######################################################
72#################### devspace open ####################
73#######################################################
74Opens the space domain in the browser
75
76Example:
77devspace open
78#######################################################
79 `,
80 Args: cobra.NoArgs,
81 RunE: func(cobraCmd *cobra.Command, args []string) error {
82 plugin.SetPluginCommand(cobraCmd, args)
83 return cmd.RunOpen(f)
84 },
85 }
86
87 openCmd.Flags().StringVar(&cmd.Provider, "provider", "", "The cloud provider to use")
88 openCmd.Flags().IntVar(&cmd.Port, "port", 0, "The port on the localhost to listen on")
89
90 return openCmd
91}
92
93// RunOpen executes the functionality "devspace open"
94func (cmd *OpenCmd) RunOpen(f factory.Factory) error {

Callers 1

BuildRootFunction · 0.85

Calls 3

RunOpenMethod · 0.95
GetInstanceFunction · 0.92
SetPluginCommandFunction · 0.92

Tested by

no test coverage detected