refactor: domainName as arg and doc strings
All checks were successful
continuous-integration/drone/push Build is passing

See coop-cloud/organising#163.
This commit is contained in:
2021-09-10 15:04:01 +02:00
parent 683ef0c3de
commit 99160967a8
4 changed files with 20 additions and 21 deletions

View File

@ -1,8 +1,6 @@
package server
import (
"errors"
"coopcloud.tech/abra/cli/internal"
"coopcloud.tech/abra/pkg/client"
"github.com/sirupsen/logrus"
@ -19,13 +17,14 @@ internal bookkeeping so that it is not managed any more.
`,
HideHelp: true,
Action: func(c *cli.Context) error {
server := c.Args().First()
if server == "" {
internal.ShowSubcommandHelpAndError(c, errors.New("no server provided"))
}
if err := client.DeleteContext(server); err != nil {
domainName := internal.ValidateDomain(c)
if err := client.DeleteContext(domainName); err != nil {
logrus.Fatal(err)
}
logrus.Infof("Server at '%s' has been forgotten", domainName)
return nil
},
}