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

@ -2,9 +2,11 @@ package server
import (
"context"
"errors"
"fmt"
"net"
"coopcloud.tech/abra/cli/internal"
"coopcloud.tech/abra/client"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/swarm"
@ -26,7 +28,7 @@ later for more advanced use cases.
Action: func(c *cli.Context) error {
host := c.Args().First()
if host == "" {
return cli.ShowSubcommandHelp(c)
internal.ShowSubcommandHelpAndError(c, errors.New("no host provided"))
}
cl, err := client.NewClientWithContext(host)