abra/cli/server/remove.go

25 lines
503 B
Go

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 == "" {
return cli.ShowSubcommandHelp(c)
}
if err := client.DeleteContext(server); err != nil {
logrus.Fatal(err)
}
return nil
},
}