diff --git a/components/gitpod-cli/cmd/await-port.go b/components/gitpod-cli/cmd/ports-await.go similarity index 77% rename from components/gitpod-cli/cmd/await-port.go rename to components/gitpod-cli/cmd/ports-await.go index ff0fd9b6061a48..cf2de99d09a2fc 100644 --- a/components/gitpod-cli/cmd/await-port.go +++ b/components/gitpod-cli/cmd/ports-await.go @@ -16,7 +16,7 @@ import ( ) var awaitPortCmd = &cobra.Command{ - Use: "await-port ", + Use: "await ", Short: "Waits for a process to listen on a port", Args: cobra.ExactArgs(1), Run: func(cmd *cobra.Command, args []string) { @@ -54,6 +54,18 @@ var awaitPortCmd = &cobra.Command{ }, } +var awaitPortCmdAlias = &cobra.Command{ + Hidden: true, + Deprecated: "please use `ports await` instead.", + Use: "await-port ", + Short: awaitPortCmd.Short, + Long: awaitPortCmd.Long, + Args: awaitPortCmd.Args, + Run: awaitPortCmd.Run, +} + func init() { - rootCmd.AddCommand(awaitPortCmd) + portsCmd.AddCommand(awaitPortCmd) + + rootCmd.AddCommand(awaitPortCmdAlias) } diff --git a/components/gitpod-cli/cmd/forward-port.go b/components/gitpod-cli/cmd/ports-expose.go similarity index 72% rename from components/gitpod-cli/cmd/forward-port.go rename to components/gitpod-cli/cmd/ports-expose.go index c26ab42c725dbd..8192ba00dcf18a 100644 --- a/components/gitpod-cli/cmd/forward-port.go +++ b/components/gitpod-cli/cmd/ports-expose.go @@ -20,8 +20,8 @@ import ( var rewriteHostHeader bool -var portFwdCmd = &cobra.Command{ - Use: "forward-port [target-port]", +var portExposeCmd = &cobra.Command{ + Use: "expose [target-port]", Short: "Makes a port available on 0.0.0.0 so that it can be exposed to the internet", Long: ``, Args: cobra.RangeArgs(1, 2), @@ -71,7 +71,20 @@ var portFwdCmd = &cobra.Command{ }, } +var portExposeCmdAlias = &cobra.Command{ + Hidden: true, + Deprecated: "please use `ports expose` instead.", + Use: "forward-port [target-port]", + Short: portExposeCmd.Short, + Long: portExposeCmd.Long, + Args: portExposeCmd.Args, + Run: portExposeCmd.Run, +} + func init() { - rootCmd.AddCommand(portFwdCmd) - portFwdCmd.Flags().BoolVarP(&rewriteHostHeader, "rewrite-host-header", "r", false, "rewrites the host header of passing HTTP requests to localhost") + portsCmd.AddCommand(portExposeCmd) + portExposeCmd.Flags().BoolVarP(&rewriteHostHeader, "rewrite-host-header", "r", false, "rewrites the host header of passing HTTP requests to localhost") + + rootCmd.AddCommand(portExposeCmdAlias) + portExposeCmdAlias.Flags().BoolVarP(&rewriteHostHeader, "rewrite-host-header", "r", false, "rewrites the host header of passing HTTP requests to localhost") }