diff --git a/cmd/flow/main.go b/cmd/flow/main.go index 45af7a606..e6c803707 100644 --- a/cmd/flow/main.go +++ b/cmd/flow/main.go @@ -32,6 +32,7 @@ import ( "github.com/onflow/flow-cli/internal/events" "github.com/onflow/flow-cli/internal/keys" "github.com/onflow/flow-cli/internal/project" + "github.com/onflow/flow-cli/internal/quick" "github.com/onflow/flow-cli/internal/scripts" "github.com/onflow/flow-cli/internal/status" "github.com/onflow/flow-cli/internal/transactions" @@ -45,8 +46,8 @@ func main() { TraverseChildren: true, } - // hot commands - config.InitCommand.AddToParent(cmd) + // quick commands + quick.InitCommand.AddToParent(cmd) status.Command.AddToParent(cmd) // structured commands @@ -61,6 +62,7 @@ func main() { cmd.AddCommand(blocks.Cmd) cmd.AddCommand(collections.Cmd) cmd.AddCommand(project.Cmd) + cmd.AddCommand(config.Cmd) command.InitFlags(cmd) diff --git a/internal/config/config.go b/internal/config/config.go index 97be054e5..7f29371ff 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -29,6 +29,7 @@ var Cmd = &cobra.Command{ } func init() { + InitCommand.AddToParent(Cmd) Cmd.AddCommand(AddCmd) Cmd.AddCommand(RemoveCmd) } diff --git a/internal/project/project.go b/internal/project/project.go index 1d766474f..ed25a8404 100644 --- a/internal/project/project.go +++ b/internal/project/project.go @@ -29,7 +29,6 @@ var Cmd = &cobra.Command{ } func init() { - InitCommand.AddToParent(Cmd) DeployCommand.AddToParent(Cmd) Cmd.AddCommand(EmulatorCommand) } diff --git a/internal/project/init.go b/internal/quick/init.go similarity index 92% rename from internal/project/init.go rename to internal/quick/init.go index a25d1b1aa..19b4fb90b 100644 --- a/internal/project/init.go +++ b/internal/quick/init.go @@ -16,7 +16,7 @@ * limitations under the License. */ -package project +package quick import ( "fmt" @@ -28,6 +28,8 @@ import ( "github.com/onflow/flow-cli/pkg/flowcli/services" ) +// TODO(sideninja) workaround - init needed to be copied in order to work else there is flag duplicate error + var initFlag = config.FlagsInit{} var InitCommand = &command.Command{ diff --git a/pkg/flowcli/config/json/account.go b/pkg/flowcli/config/json/account.go index 02b66205c..dda32c33c 100644 --- a/pkg/flowcli/config/json/account.go +++ b/pkg/flowcli/config/json/account.go @@ -139,6 +139,7 @@ func transformAccountsToJSON(accounts config.Accounts) jsonAccounts { return jsonAccounts } +// TODO(sideninja) refactor keys to use json.RawMessage and decide if unmarshal into simple or advance structure based on that field type jsonAccountSimple struct { Address string `json:"address"` Keys string `json:"keys"`