diff --git a/gno.land/cmd/gnokey/main.go b/gno.land/cmd/gnokey/main.go index 20ae8268b23..62c496efb74 100644 --- a/gno.land/cmd/gnokey/main.go +++ b/gno.land/cmd/gnokey/main.go @@ -5,6 +5,7 @@ import ( "fmt" "os" + "github.com/gnolang/gno/gno.land/pkg/keyscli" "github.com/gnolang/gno/gnovm/pkg/gnoenv" "github.com/gnolang/gno/tm2/pkg/commands" "github.com/gnolang/gno/tm2/pkg/crypto/keys/client" @@ -16,7 +17,7 @@ func main() { Remote: "127.0.0.1:26657", } - cmd := NewRoot(commands.NewDefaultIO(), baseCfg) + cmd := keyscli.NewRootCmd(commands.NewDefaultIO(), baseCfg) if err := cmd.ParseAndRun(context.Background(), os.Args[1:]); err != nil { _, _ = fmt.Fprintf(os.Stderr, "%+v\n", err) diff --git a/gno.land/pkg/integration/testing_integration.go b/gno.land/pkg/integration/testing_integration.go index 0d19237eab3..f46437859fb 100644 --- a/gno.land/pkg/integration/testing_integration.go +++ b/gno.land/pkg/integration/testing_integration.go @@ -10,6 +10,7 @@ import ( "strings" "testing" + "github.com/gnolang/gno/gno.land/pkg/keyscli" "github.com/gnolang/gno/gnovm/pkg/gnoenv" "github.com/gnolang/gno/tm2/pkg/bft/node" "github.com/gnolang/gno/tm2/pkg/commands" @@ -181,7 +182,7 @@ func setupGnolandTestScript(t *testing.T, txtarDir string) testscript.Params { io := commands.NewTestIO() io.SetOut(commands.WriteNopCloser(ts.Stdout())) io.SetErr(commands.WriteNopCloser(ts.Stderr())) - cmd := client.NewRootCmd(io) + cmd := keyscli.NewRootCmd(io, client.DefaultBaseOptions) io.SetIn(strings.NewReader("\n")) // Inject empty password to stdin. defaultArgs := []string{ diff --git a/gno.land/cmd/gnokey/addpkg.go b/gno.land/pkg/keyscli/addpkg.go similarity index 99% rename from gno.land/cmd/gnokey/addpkg.go rename to gno.land/pkg/keyscli/addpkg.go index df21298387c..72beca0e24f 100644 --- a/gno.land/cmd/gnokey/addpkg.go +++ b/gno.land/pkg/keyscli/addpkg.go @@ -1,4 +1,4 @@ -package main +package keyscli // TODO: move most of the logic in ROOT/gno.land/... diff --git a/gno.land/cmd/gnokey/call.go b/gno.land/pkg/keyscli/call.go similarity index 99% rename from gno.land/cmd/gnokey/call.go rename to gno.land/pkg/keyscli/call.go index d7991268e64..5afbdf457b8 100644 --- a/gno.land/cmd/gnokey/call.go +++ b/gno.land/pkg/keyscli/call.go @@ -1,4 +1,4 @@ -package main +package keyscli import ( "context" diff --git a/gno.land/cmd/gnokey/maketx.go b/gno.land/pkg/keyscli/maketx.go similarity index 98% rename from gno.land/cmd/gnokey/maketx.go rename to gno.land/pkg/keyscli/maketx.go index 73254c02955..3aa54546863 100644 --- a/gno.land/cmd/gnokey/maketx.go +++ b/gno.land/pkg/keyscli/maketx.go @@ -1,4 +1,4 @@ -package main +package keyscli import ( "flag" diff --git a/gno.land/cmd/gnokey/root.go b/gno.land/pkg/keyscli/root.go similarity index 88% rename from gno.land/cmd/gnokey/root.go rename to gno.land/pkg/keyscli/root.go index 77b69416b0a..dc5a4f1f9af 100644 --- a/gno.land/cmd/gnokey/root.go +++ b/gno.land/pkg/keyscli/root.go @@ -1,5 +1,5 @@ // Dedicated to my love, Lexi. -package main +package keyscli import ( "github.com/gnolang/gno/tm2/pkg/commands" @@ -9,7 +9,7 @@ import ( "github.com/peterbourgon/ff/v3/fftoml" ) -func NewRoot(io commands.IO, base client.BaseOptions) *commands.Command { +func NewRootCmd(io commands.IO, base client.BaseOptions) *commands.Command { cfg := &client.BaseCfg{ BaseOptions: base, } @@ -39,7 +39,7 @@ func NewRoot(io commands.IO, base client.BaseOptions) *commands.Command { client.NewQueryCmd(cfg, io), client.NewBroadcastCmd(cfg, io), - // Use custom MakeTX command + // Custom MakeTX command NewMakeTxCmd(cfg, io), ) diff --git a/gno.land/cmd/gnokey/run.go b/gno.land/pkg/keyscli/run.go similarity index 99% rename from gno.land/cmd/gnokey/run.go rename to gno.land/pkg/keyscli/run.go index 85d6647214f..b5d3ab31ab5 100644 --- a/gno.land/cmd/gnokey/run.go +++ b/gno.land/pkg/keyscli/run.go @@ -1,4 +1,4 @@ -package main +package keyscli import ( "context"