mirror of
https://github.com/coder/coder.git
synced 2026-06-05 05:58:20 +00:00
03ab37b343
This cleans up `root.go` a bit, adds tests for middleware HTTP transport functions, and removes two HTTP requests we always always performed previously when executing *any* client command. It should improve CLI performance (especially for users with higher latency).
27 lines
461 B
Go
27 lines
461 B
Go
package cli
|
|
|
|
import (
|
|
"github.com/coder/coder/v2/cli"
|
|
"github.com/coder/serpent"
|
|
)
|
|
|
|
type RootCmd struct {
|
|
cli.RootCmd
|
|
}
|
|
|
|
func (r *RootCmd) enterpriseOnly() []*serpent.Command {
|
|
return []*serpent.Command{
|
|
r.Server(nil),
|
|
r.workspaceProxy(),
|
|
r.features(),
|
|
r.licenses(),
|
|
r.groups(),
|
|
r.provisionerDaemons(),
|
|
}
|
|
}
|
|
|
|
func (r *RootCmd) EnterpriseSubcommands() []*serpent.Command {
|
|
all := append(r.CoreSubcommands(), r.enterpriseOnly()...)
|
|
return all
|
|
}
|