mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add port-forward subcommand (#1350)
This commit is contained in:
+11
-8
@@ -36,6 +36,15 @@ const (
|
||||
varForceTty = "force-tty"
|
||||
)
|
||||
|
||||
func init() {
|
||||
// Customizes the color of headings to make subcommands more visually
|
||||
// appealing.
|
||||
header := cliui.Styles.Placeholder
|
||||
cobra.AddTemplateFunc("usageHeader", func(s string) string {
|
||||
return header.Render(s)
|
||||
})
|
||||
}
|
||||
|
||||
func Root() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "coder",
|
||||
@@ -71,7 +80,7 @@ func Root() *cobra.Command {
|
||||
templates(),
|
||||
update(),
|
||||
users(),
|
||||
tunnel(),
|
||||
portForward(),
|
||||
workspaceAgent(),
|
||||
)
|
||||
|
||||
@@ -179,13 +188,7 @@ func isTTY(cmd *cobra.Command) bool {
|
||||
}
|
||||
|
||||
func usageTemplate() string {
|
||||
// Customizes the color of headings to make subcommands
|
||||
// more visually appealing.
|
||||
header := cliui.Styles.Placeholder
|
||||
cobra.AddTemplateFunc("usageHeader", func(s string) string {
|
||||
return header.Render(s)
|
||||
})
|
||||
|
||||
// usageHeader is defined in init().
|
||||
return `{{usageHeader "Usage:"}}
|
||||
{{- if .Runnable}}
|
||||
{{.UseLine}}
|
||||
|
||||
Reference in New Issue
Block a user