refactor: break up cli pkg into nice small chunks
This commit is contained in:
25
cli/server/remove.go
Normal file
25
cli/server/remove.go
Normal file
@ -0,0 +1,25 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"coopcloud.tech/abra/client"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
var serverRemoveCommand = &cli.Command{
|
||||
Name: "remove",
|
||||
Aliases: []string{"rm", "delete"},
|
||||
Usage: "Remove a locally-defined server",
|
||||
HideHelp: true,
|
||||
Action: func(c *cli.Context) error {
|
||||
server := c.Args().First()
|
||||
if server == "" {
|
||||
cli.ShowSubcommandHelp(c)
|
||||
return nil
|
||||
}
|
||||
if err := client.DeleteContext(server); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
return nil
|
||||
},
|
||||
}
|
Reference in New Issue
Block a user