diff --git a/cmd/root.go b/cmd/root.go index 7852c8b..f7cc925 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -80,7 +80,7 @@ func Execute(buildInfo *openhue.BuildInfo) { root.AddCommand(version.NewCmdVersion(ctx)) root.AddCommand(setup.NewCmdSetup(ctx.Io)) root.AddCommand(setup.NewCmdDiscover(ctx.Io)) - root.AddCommand(setup.NewCmdConfigure()) + root.AddCommand(setup.NewCmdConfigure(ctx.Io)) root.AddCommand(set.NewCmdSet(ctx)) root.AddCommand(get.NewCmdGet(ctx)) diff --git a/cmd/setup/config.go b/cmd/setup/config.go index b4638a8..3f3cb83 100644 --- a/cmd/setup/config.go +++ b/cmd/setup/config.go @@ -1,6 +1,7 @@ package setup import ( + "fmt" "github.com/spf13/cobra" "openhue-cli/openhue" ) @@ -19,7 +20,7 @@ type Options struct { } // NewCmdConfigure creates the configure command -func NewCmdConfigure() *cobra.Command { +func NewCmdConfigure(io openhue.IOStreams) *cobra.Command { o := Options{} @@ -35,8 +36,9 @@ func NewCmdConfigure() *cobra.Command { Key: o.key, } - _, err := c.Save() + path, err := c.Save() cobra.CheckErr(err) + fmt.Fprintln(io.Out, "[OK] Configuration saved in file", path) }, }