Skip to content

Commit

Permalink
chore: make gnokeykc use gnokey's basecfg (#1531)
Browse files Browse the repository at this point in the history
Related with #1233.

## Before

```
$ gnokeykc --help                                                                                                                                                                                                                                                            
[...]
  -config ...                     config file (optional)                                                                                                                                                                                                                                                 
[...]
```

## After

```
$ gnokeykc --help                                                                                                                                                                                                                                                                 
[...]
  -home /Users/moul/Library/Application Support/gno  home directory                                                                                                                                                                                                                                      
[...]
```

<details><summary>Contributors' checklist...</summary>

- [x] Added new tests, or not needed, or not feasible
- [x] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [x] Updated the official documentation or not needed
- [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [x] Added references to related issues and PRs
- [x] Provided any useful hints for running manual tests
- [x] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>

---------

Signed-off-by: moul <94029+moul@users.noreply.github.com>
Co-authored-by: Morgan <git@howl.moe>
Co-authored-by: Hariom Verma <hariom18599@gmail.com>
  • Loading branch information
3 people committed Jan 18, 2024
1 parent 17b1303 commit 37e7258
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion contribs/gnokeykc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"os"

"github.com/gnolang/gno/gnovm/pkg/gnoenv"
"github.com/gnolang/gno/tm2/pkg/commands"
"github.com/gnolang/gno/tm2/pkg/crypto/keys/client"
"github.com/zalando/go-keyring"
Expand All @@ -12,7 +13,9 @@ import (
func main() {
stdio := commands.NewDefaultIO()
wrappedio := &wrappedIO{IO: stdio}
cmd := client.NewRootCmd(wrappedio)
baseCfg := client.DefaultBaseOptions
baseCfg.Home = gnoenv.HomeDir()
cmd := client.NewRootCmdWithBaseConfig(wrappedio, baseCfg)
cmd.AddSubCommands(newKcCmd(stdio))

cmd.Execute(context.Background(), os.Args[1:])
Expand Down

0 comments on commit 37e7258

Please sign in to comment.