Skip to content

Commit

Permalink
refactored config code
Browse files Browse the repository at this point in the history
  • Loading branch information
rm-Umar committed Dec 8, 2021
1 parent f92cd67 commit 61d60bb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ipinfo/cmd_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,18 @@ import (
"fmt"
"strings"

"github.com/ipinfo/cli/lib/complete"
"github.com/ipinfo/cli/lib/complete/predict"
"github.com/spf13/pflag"
)

var completionsConfig = &complete.Command{
Flags: map[string]complete.Predictor{
"-h": predict.Nothing,
"--help": predict.Nothing,
},
}

func printHelpConfig() {
fmt.Printf(
`Usage: %s config [<key>=<value>...]
Expand Down
1 change: 1 addition & 0 deletions ipinfo/completions.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ var completions = &complete.Command{
"cache": completionsCache,
"login": completionsLogin,
"logout": completionsLogout,
"config": completionsConfig,
"completion": completionsCompletion,
"version": completionsVersion,
},
Expand Down

0 comments on commit 61d60bb

Please sign in to comment.