From bfd4ce96bbe9d3428479440a0399c619e10cd300 Mon Sep 17 00:00:00 2001 From: Rigel Rozanski Date: Wed, 30 Aug 2017 19:25:35 -0400 Subject: [PATCH] added init option flag and tests --- server/commands/init.go | 28 ++++++++++++++++++++++++---- tests/cli/init-server.sh | 23 +++++++++++++++++++++++ 2 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 tests/cli/init-server.sh diff --git a/server/commands/init.go b/server/commands/init.go index bb8617d08..e4a584440 100644 --- a/server/commands/init.go +++ b/server/commands/init.go @@ -5,6 +5,7 @@ import ( "fmt" "io/ioutil" "os" + "strings" "github.com/pkg/errors" "github.com/spf13/cobra" @@ -25,10 +26,12 @@ var InitCmd = &cobra.Command{ //nolint - flags var ( FlagChainID = "chain-id" //TODO group with other flags or remove? is this already a flag here? + FlagOption = "option" ) func init() { InitCmd.Flags().String(FlagChainID, "test_chain_id", "Chain ID") + InitCmd.Flags().StringSlice(FlagOption, []string{}, "Genesis option in the format /