From 2fc340db62aa6d77c0818a6769f2b71860d50bff Mon Sep 17 00:00:00 2001 From: Phillip Wittrock Date: Mon, 13 Jan 2020 10:03:18 -0800 Subject: [PATCH] Export cmd/config commands so they can be composed more easily --- cmd/config/configcobra/cmds.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/cmd/config/configcobra/cmds.go b/cmd/config/configcobra/cmds.go index 6151809a5..b21c9ea50 100644 --- a/cmd/config/configcobra/cmds.go +++ b/cmd/config/configcobra/cmds.go @@ -43,6 +43,26 @@ Advanced Documentation Topics: `, } +// Export commands publicly for composition +var ( + Cat = commands.CatCommand + Count = commands.CountCommand + CreateSetter = commands.CreateSetterCommand + Fmt = commands.FmtCommand + Grep = commands.GrepCommand + ListSetters = commands.ListSettersCommand + Merge = commands.MergeCommand + Merge3 = commands.Merge3Command + RunFn = commands.RunFnCommand + Set = commands.SetCommand + Sink = commands.SinkCommand + Source = commands.SourceCommand + Tree = commands.TreeCommand + + StackOnError = &commands.StackOnError + ExitOnError = &commands.ExitOnError +) + // NewConfigCommand returns a new *cobra.Command for the config command group. This may // be embedded into other go binaries as a way of packaging the "config" command as part // of another binary.