From 7f759f22e548d9feb72066c6a31e1da0b8494a7a Mon Sep 17 00:00:00 2001 From: Kedas Date: Mon, 18 Jul 2022 23:54:28 +0000 Subject: [PATCH 1/3] make `myip` command not cache by default --- ipinfo/cmd_myip.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ipinfo/cmd_myip.go b/ipinfo/cmd_myip.go index d3a4ac7c..9272b7fb 100644 --- a/ipinfo/cmd_myip.go +++ b/ipinfo/cmd_myip.go @@ -14,7 +14,7 @@ var completionsMyIP = &complete.Command{ Flags: map[string]complete.Predictor{ "-t": predict.Nothing, "--token": predict.Nothing, - "--nocache": predict.Nothing, + "--cache": predict.Nothing, "-h": predict.Nothing, "--help": predict.Nothing, "-f": predict.Set(coreFields), @@ -37,8 +37,8 @@ Options: General: --token , -t use as API token. - --nocache - do not use the cache. + --cache + use the cache. --help, -h show help. @@ -68,7 +68,7 @@ func cmdMyIP() error { var fCSV bool pflag.StringVarP(&fTok, "token", "t", "", "the token to use.") - pflag.BoolVar(&fNoCache, "nocache", false, "disable the cache.") + pflag.BoolVar(&fNoCache, "cache", false, "use the cache.") pflag.BoolVarP(&fHelp, "help", "h", false, "show help.") pflag.StringSliceVarP(&fField, "field", "f", nil, "specific field to lookup.") pflag.BoolVarP(&fPretty, "pretty", "p", true, "output pretty format.") @@ -77,6 +77,8 @@ func cmdMyIP() error { pflag.BoolVar(&fNoColor, "nocolor", false, "disable color output.") pflag.Parse() + fNoCache = !fNoCache + if fNoColor { color.NoColor = true } From a56442c8d170cf62c0b0482d87b8ef556d644b30 Mon Sep 17 00:00:00 2001 From: Kedas Date: Tue, 19 Jul 2022 15:13:38 +0000 Subject: [PATCH 2/3] make `myip`'s `--nocache` flag default to true --- ipinfo/cmd_myip.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ipinfo/cmd_myip.go b/ipinfo/cmd_myip.go index 9272b7fb..882e67de 100644 --- a/ipinfo/cmd_myip.go +++ b/ipinfo/cmd_myip.go @@ -14,7 +14,7 @@ var completionsMyIP = &complete.Command{ Flags: map[string]complete.Predictor{ "-t": predict.Nothing, "--token": predict.Nothing, - "--cache": predict.Nothing, + "--nocache": predict.Nothing, "-h": predict.Nothing, "--help": predict.Nothing, "-f": predict.Set(coreFields), @@ -37,8 +37,8 @@ Options: General: --token , -t use as API token. - --cache - use the cache. + --nocache + do not use the cache. --help, -h show help. @@ -68,7 +68,7 @@ func cmdMyIP() error { var fCSV bool pflag.StringVarP(&fTok, "token", "t", "", "the token to use.") - pflag.BoolVar(&fNoCache, "cache", false, "use the cache.") + pflag.BoolVar(&fNoCache, "nocache", true, "disable the cache.") pflag.BoolVarP(&fHelp, "help", "h", false, "show help.") pflag.StringSliceVarP(&fField, "field", "f", nil, "specific field to lookup.") pflag.BoolVarP(&fPretty, "pretty", "p", true, "output pretty format.") @@ -77,8 +77,6 @@ func cmdMyIP() error { pflag.BoolVar(&fNoColor, "nocolor", false, "disable color output.") pflag.Parse() - fNoCache = !fNoCache - if fNoColor { color.NoColor = true } From 44a34f659a5f33f4c615d6538c017785e1c55db3 Mon Sep 17 00:00:00 2001 From: Kedas Date: Tue, 19 Jul 2022 15:54:48 +0000 Subject: [PATCH 3/3] fix tab spacing --- ipinfo/cmd_myip.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipinfo/cmd_myip.go b/ipinfo/cmd_myip.go index 882e67de..3dbef01c 100644 --- a/ipinfo/cmd_myip.go +++ b/ipinfo/cmd_myip.go @@ -37,7 +37,7 @@ Options: General: --token , -t use as API token. - --nocache + --nocache do not use the cache. --help, -h show help.