mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore(cli): rename Cmd to Command (#12616)
I think Command is cleaner and my original decision to use "Cmd" a mistake. Plus this creates better parity with cobra.
This commit is contained in:
+5
-5
@@ -13,9 +13,9 @@ import (
|
||||
"github.com/coder/serpent"
|
||||
)
|
||||
|
||||
func (RootCmd) errorExample() *serpent.Cmd {
|
||||
errorCmd := func(use string, err error) *serpent.Cmd {
|
||||
return &serpent.Cmd{
|
||||
func (RootCmd) errorExample() *serpent.Command {
|
||||
errorCmd := func(use string, err error) *serpent.Command {
|
||||
return &serpent.Command{
|
||||
Use: use,
|
||||
Handler: func(inv *serpent.Invocation) error {
|
||||
return err
|
||||
@@ -52,7 +52,7 @@ func (RootCmd) errorExample() *serpent.Cmd {
|
||||
// Some flags
|
||||
var magicWord serpent.String
|
||||
|
||||
cmd := &serpent.Cmd{
|
||||
cmd := &serpent.Command{
|
||||
Use: "example-error",
|
||||
Short: "Shows what different error messages look like",
|
||||
Long: "This command is pretty pointless, but without it testing errors is" +
|
||||
@@ -61,7 +61,7 @@ func (RootCmd) errorExample() *serpent.Cmd {
|
||||
Handler: func(inv *serpent.Invocation) error {
|
||||
return inv.Command.HelpHandler(inv)
|
||||
},
|
||||
Children: []*serpent.Cmd{
|
||||
Children: []*serpent.Command{
|
||||
// Typical codersdk api error
|
||||
errorCmd("api", apiError),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user