github.com/elopio/cli@v6.21.2-0.20160902224010-ea909d1fdb2f+incompatible/commands/v2/map_route_command.go (about)

     1  package v2
     2  
     3  import (
     4  	"os"
     5  
     6  	"code.cloudfoundry.org/cli/cf/cmd"
     7  	"code.cloudfoundry.org/cli/commands"
     8  	"code.cloudfoundry.org/cli/commands/flags"
     9  )
    10  
    11  type MapRouteCommand struct {
    12  	RequiredArgs    flags.AppDomain `positional-args:"yes"`
    13  	Hostname        string          `long:"hostname" short:"n" description:"Hostname for the HTTP route (required for shared domains)"`
    14  	Path            string          `long:"path" description:"Path for the HTTP route"`
    15  	Port            int             `long:"port" description:"Port for the TCP route"`
    16  	RandomPort      bool            `long:"random-port" description:"Create a random port for the TCP route"`
    17  	usage           interface{}     `usage:"Map an HTTP route:\n      CF_NAME map-route APP_NAME DOMAIN [--hostname HOSTNAME] [--path PATH]\n\n   Map a TCP route:\n      CF_NAME map-route APP_NAME DOMAIN (--port PORT | --random-port)\n\nEXAMPLES:\n   CF_NAME map-route my-app example.com                              # example.com\n   CF_NAME map-route my-app example.com --hostname myhost            # myhost.example.com\n   CF_NAME map-route my-app example.com --hostname myhost --path foo # myhost.example.com/foo\n   CF_NAME map-route my-app example.com --port 5000                  # example.com:5000"`
    18  	relatedCommands interface{}     `related_commands:"create-route, routes"`
    19  }
    20  
    21  func (_ MapRouteCommand) Setup(config commands.Config, ui commands.UI) error {
    22  	return nil
    23  }
    24  
    25  func (_ MapRouteCommand) Execute(args []string) error {
    26  	cmd.Main(os.Getenv("CF_TRACE"), os.Args)
    27  	return nil
    28  }