refactor: use new internal arg failure func

This commit is contained in:
2021-08-03 13:57:12 +02:00
parent 43238d379c
commit 471c982f63
4 changed files with 15 additions and 6 deletions

View File

@ -1,6 +1,9 @@
package server
import (
"errors"
"coopcloud.tech/abra/cli/internal"
"coopcloud.tech/abra/client"
"github.com/sirupsen/logrus"
"github.com/urfave/cli/v2"
@ -14,7 +17,7 @@ var serverRemoveCommand = &cli.Command{
Action: func(c *cli.Context) error {
server := c.Args().First()
if server == "" {
return cli.ShowSubcommandHelp(c)
internal.ShowSubcommandHelpAndError(c, errors.New("no server provided"))
}
if err := client.DeleteContext(server); err != nil {
logrus.Fatal(err)