MCPcopy Create free account
hub / github.com/devspace-sh/devspace / newPortsCmd

Function newPortsCmd

cmd/list/ports.go:28–48  ·  view source on GitHub ↗
(f factory.Factory, globalFlags *flags.GlobalFlags)

Source from the content-addressed store, hash-verified

26}
27
28func newPortsCmd(f factory.Factory, globalFlags *flags.GlobalFlags) *cobra.Command {
29 cmd := &portsCmd{GlobalFlags: globalFlags}
30
31 portsCmd := &cobra.Command{
32 Use: "ports",
33 Short: "Lists port forwarding configurations",
34 Long: `
35#######################################################
36############### devspace list ports ###################
37#######################################################
38Lists the port forwarding configurations
39#######################################################
40 `,
41 Args: cobra.NoArgs,
42 RunE: func(cobraCmd *cobra.Command, args []string) error {
43 return cmd.RunListPort(f, cobraCmd, args)
44 }}
45
46 portsCmd.Flags().StringVarP(&cmd.Output, "output", "o", "", "The output format of the command. Can be either empty or json")
47 return portsCmd
48}
49
50// RunListPort runs the list port command logic
51func (cmd *portsCmd) RunListPort(f factory.Factory, cobraCmd *cobra.Command, args []string) error {

Callers 1

NewListCmdFunction · 0.85

Calls 1

RunListPortMethod · 0.95

Tested by

no test coverage detected