Skip to content

Commit efc7028

Browse files
committed
v7: Update help text for create-route
Add details about the `--port` flag and distinguish between HTTP and TCP domain use-cases. [Finishes #172510259] Authored-by: Reid Mitchell <[email protected]>
1 parent 20298c8 commit efc7028

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

command/v7/create_route_command.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ type CreateRouteCommand struct {
1111
BaseCommand
1212

1313
RequiredArgs flag.Domain `positional-args:"yes"`
14-
usage interface{} `usage:"CF_NAME create-route DOMAIN [--hostname HOSTNAME] [--path PATH]\n\nEXAMPLES:\n CF_NAME create-route example.com # example.com\n CF_NAME create-route example.com --hostname myapp # myapp.example.com\n CF_NAME create-route example.com --hostname myapp --path foo # myapp.example.com/foo"`
14+
usage interface{} `usage:"Create an HTTP route:\n CF_NAME create-route DOMAIN [--hostname HOSTNAME] [--path PATH]\n\n Create a TCP route:\n CF_NAME create-route DOMAIN [--port PORT]\n\nEXAMPLES:\n CF_NAME create-route example.com # example.com\n CF_NAME create-route example.com --hostname myapp # myapp.example.com\n CF_NAME create-route example.com --hostname myapp --path foo # myapp.example.com/foo\n CF_NAME create-route example.com --port 5000 # example.com:5000"`
1515
Hostname string `long:"hostname" short:"n" description:"Hostname for the HTTP route (required for shared domains)"`
1616
Path flag.V7RoutePath `long:"path" description:"Path for the HTTP route"`
1717
Port int `long:"port" description:"Port for the TCP route (default: random port)"`

integration/v7/isolated/create_route_command_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,23 @@ var _ = Describe("create-route command", func() {
2626
Eventually(session).Should(Say(`\n`))
2727

2828
Eventually(session).Should(Say(`USAGE:`))
29+
Eventually(session).Should(Say(`Create an HTTP route:\n`))
2930
Eventually(session).Should(Say(`cf create-route DOMAIN \[--hostname HOSTNAME\] \[--path PATH\]\n`))
31+
Eventually(session).Should(Say(`Create a TCP route:\n`))
32+
Eventually(session).Should(Say(`cf create-route DOMAIN \[--port PORT\]\n`))
3033
Eventually(session).Should(Say(`\n`))
3134

3235
Eventually(session).Should(Say(`EXAMPLES:`))
3336
Eventually(session).Should(Say(`cf create-route example.com\s+# example.com`))
3437
Eventually(session).Should(Say(`cf create-route example.com --hostname myapp\s+# myapp.example.com`))
3538
Eventually(session).Should(Say(`cf create-route example.com --hostname myapp --path foo\s+# myapp.example.com/foo`))
39+
Eventually(session).Should(Say(`cf create-route example.com --port 5000\s+# example.com:5000`))
3640
Eventually(session).Should(Say(`\n`))
3741

3842
Eventually(session).Should(Say(`OPTIONS:`))
3943
Eventually(session).Should(Say(`--hostname, -n\s+Hostname for the HTTP route \(required for shared domains\)`))
4044
Eventually(session).Should(Say(`--path\s+Path for the HTTP route`))
45+
Eventually(session).Should(Say(`--port\s+Port for the TCP route \(default: random port\)`))
4146
Eventually(session).Should(Say(`\n`))
4247

4348
Eventually(session).Should(Say(`SEE ALSO:`))

0 commit comments

Comments
 (0)