pull/38/head
Chris Bednarski 4 years ago
parent ba102742d4
commit 9c247955f6

@ -18,7 +18,7 @@ const (
type Options struct {
IPVersion int
Preview bool
Preview bool
}
// PrintErrLn will print to stderr followed by a newline
@ -259,7 +259,6 @@ func Apply(options *Options, filename string) error {
return err
}
if err := hostfile.Hosts.Apply(jsonbytes); err != nil {
return fmt.Errorf("Error applying changes to hosts file: %s", err)
}

@ -2,14 +2,14 @@ package main
import (
"testing"
)
)
func TestStrPadRight(t *testing.T) {
type testCase struct {
Expected string
Output string
Name string
Output string
Name string
}
cases := []testCase{

@ -67,9 +67,9 @@ func CommandUsage(command string) error {
func wrappedMain() error {
cli := flag.NewFlagSet(os.Args[0], flag.ExitOnError)
ipv4 := cli.Bool("4",false, "IPv4")
ipv6 := cli.Bool("6",false, "IPv6")
preview := cli.Bool("n",false, "preview")
ipv4 := cli.Bool("4", false, "IPv4")
ipv6 := cli.Bool("6", false, "IPv6")
preview := cli.Bool("n", false, "preview")
cli.Usage = func() {
fmt.Printf(help, hostess.GetHostsPath())
}
@ -83,10 +83,10 @@ func wrappedMain() error {
Preview: *preview,
}
if *ipv4 {
options.IPVersion = options.IPVersion| IPv4
options.IPVersion = options.IPVersion | IPv4
}
if *ipv6 {
options.IPVersion = options.IPVersion| IPv6
options.IPVersion = options.IPVersion | IPv6
}
command := cli.Arg(0)

Loading…
Cancel
Save