From 37e7258e157ca4114dfe3b298971715c01f76616 Mon Sep 17 00:00:00 2001
From: Manfred Touron <94029+moul@users.noreply.github.com>
Date: Thu, 18 Jan 2024 18:16:41 +0100
Subject: [PATCH] chore: make gnokeykc use gnokey's basecfg (#1531)
Related with #1233.
## Before
```
$ gnokeykc --help
[...]
-config ... config file (optional)
[...]
```
## After
```
$ gnokeykc --help
[...]
-home /Users/moul/Library/Application Support/gno home directory
[...]
```
Contributors' checklist...
- [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).
---------
Signed-off-by: moul <94029+moul@users.noreply.github.com>
Co-authored-by: Morgan
Co-authored-by: Hariom Verma
---
contribs/gnokeykc/main.go | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/contribs/gnokeykc/main.go b/contribs/gnokeykc/main.go
index 9171066fb5b..2065725e5b6 100644
--- a/contribs/gnokeykc/main.go
+++ b/contribs/gnokeykc/main.go
@@ -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"
@@ -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:])