mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
Enable --diff2 flag anywhere on the command line (#2281)
Co-authored-by: Tom Limoncelli <tal@whatexit.org>
This commit is contained in:
@ -10,6 +10,7 @@ import (
|
||||
|
||||
"github.com/StackExchange/dnscontrol/v3/models"
|
||||
"github.com/StackExchange/dnscontrol/v3/pkg/credsfile"
|
||||
"github.com/StackExchange/dnscontrol/v3/pkg/diff2"
|
||||
"github.com/StackExchange/dnscontrol/v3/pkg/nameservers"
|
||||
"github.com/StackExchange/dnscontrol/v3/pkg/normalize"
|
||||
"github.com/StackExchange/dnscontrol/v3/pkg/notifications"
|
||||
@ -67,6 +68,11 @@ func (args *PreviewArgs) flags() []cli.Flag {
|
||||
Destination: &args.Full,
|
||||
Usage: `Add headings, providers names, notifications of no changes, etc`,
|
||||
})
|
||||
flags = append(flags, &cli.BoolFlag{
|
||||
Name: "diff2",
|
||||
Destination: &diff2.EnableDiff2,
|
||||
Usage: `Enable replacement diff algorithm`,
|
||||
})
|
||||
return flags
|
||||
}
|
||||
|
||||
@ -115,6 +121,12 @@ func run(args PreviewArgs, push bool, interactive bool, out printer.CLI) error {
|
||||
// This is a hack until we have the new printer replacement.
|
||||
printer.SkinnyReport = !args.Full
|
||||
|
||||
if diff2.EnableDiff2 {
|
||||
printer.Println("INFO: Diff2 algorithm in use.")
|
||||
} else {
|
||||
printer.Println("INFO: Old diff algorithm in use. Please test --diff2 as it will be the default in releases after 2023-05-07. See https://github.com/StackExchange/dnscontrol/issues/2262")
|
||||
}
|
||||
|
||||
cfg, err := GetDNSConfig(args.GetDNSConfigArgs)
|
||||
if err != nil {
|
||||
return err
|
||||
|
Reference in New Issue
Block a user