refactor!: migrate to urfave/cli v1
All checks were successful
continuous-integration/drone/push Build is passing

Better flexible flags handling.
This commit is contained in:
2022-01-18 14:13:20 +01:00
parent c6db9ee355
commit 0e688f1407
48 changed files with 502 additions and 405 deletions

View File

@ -1,6 +1,7 @@
package record
import (
"context"
"fmt"
"strconv"
@ -11,20 +12,23 @@ import (
"github.com/libdns/gandi"
"github.com/libdns/libdns"
"github.com/sirupsen/logrus"
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
)
// RecordRemoveCommand lists domains.
var RecordRemoveCommand = &cli.Command{
var RecordRemoveCommand = cli.Command{
Name: "remove",
Usage: "Remove a domain name record",
Aliases: []string{"rm"},
ArgsUsage: "<zone>",
Flags: []cli.Flag{
internal.DebugFlag,
internal.NoInputFlag,
internal.DNSProviderFlag,
internal.DNSTypeFlag,
internal.DNSNameFlag,
},
Before: internal.SubCommandBefore,
Description: `
This command removes a domain name record for a specific zone.
@ -70,7 +74,7 @@ You may also invoke this command in "wizard" mode and be prompted for input
logrus.Fatal(err)
}
records, err := provider.GetRecords(c.Context, zone)
records, err := provider.GetRecords(context.Background(), zone)
if err != nil {
logrus.Fatal(err)
}
@ -120,7 +124,7 @@ You may also invoke this command in "wizard" mode and be prompted for input
}
}
_, err = provider.DeleteRecords(c.Context, zone, []libdns.Record{toDelete})
_, err = provider.DeleteRecords(context.Background(), zone, []libdns.Record{toDelete})
if err != nil {
logrus.Fatal(err)
}