Skip to content

Commit 311d13c

Browse files
CuriousCorrelationroboquat
authored andcommitted
[gp-cli] Move forward-port subcmd to ports expose
`forward-port` is now deprecated. New cmd is `gp ports expose`. `forward-port` is now an alias for `ports expose` for backwards compatibility.
1 parent 09959a9 commit 311d13c

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

components/gitpod-cli/cmd/forward-port.go renamed to components/gitpod-cli/cmd/ports-expose.go

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import (
2020

2121
var rewriteHostHeader bool
2222

23-
var portFwdCmd = &cobra.Command{
24-
Use: "forward-port <local-port> [target-port]",
23+
var portExposeCmd = &cobra.Command{
24+
Use: "expose <local-port> [target-port]",
2525
Short: "Makes a port available on 0.0.0.0 so that it can be exposed to the internet",
2626
Long: ``,
2727
Args: cobra.RangeArgs(1, 2),
@@ -71,7 +71,20 @@ var portFwdCmd = &cobra.Command{
7171
},
7272
}
7373

74+
var portExposeCmdAlias = &cobra.Command{
75+
Hidden: true,
76+
Deprecated: "please use `ports expose` instead.",
77+
Use: "forward-port <local-port> [target-port]",
78+
Short: portExposeCmd.Short,
79+
Long: portExposeCmd.Long,
80+
Args: portExposeCmd.Args,
81+
Run: portExposeCmd.Run,
82+
}
83+
7484
func init() {
75-
rootCmd.AddCommand(portFwdCmd)
76-
portFwdCmd.Flags().BoolVarP(&rewriteHostHeader, "rewrite-host-header", "r", false, "rewrites the host header of passing HTTP requests to localhost")
85+
portsCmd.AddCommand(portExposeCmd)
86+
portExposeCmd.Flags().BoolVarP(&rewriteHostHeader, "rewrite-host-header", "r", false, "rewrites the host header of passing HTTP requests to localhost")
87+
88+
rootCmd.AddCommand(portExposeCmdAlias)
89+
portExposeCmdAlias.Flags().BoolVarP(&rewriteHostHeader, "rewrite-host-header", "r", false, "rewrites the host header of passing HTTP requests to localhost")
7790
}

0 commit comments

Comments
 (0)