refactor!: migrate to urfave/cli v1
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Better flexible flags handling.
This commit is contained in:
@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user