feat: multi-level configuration and profiles (#3337)

Signed-off-by: Keith Zantow <kzantow@gmail.com>
This commit is contained in:
Keith Zantow
2024-10-23 12:15:59 -04:00
committed by GitHub
parent a00533c836
commit 759b898df5
8 changed files with 268 additions and 33 deletions
+4 -4
View File
@@ -20,18 +20,18 @@ func AppClioSetupConfig(id clio.Identification, out io.Writer) *clio.SetupConfig
WithConfigInRootHelp(). // --help on the root command renders the full application config in the help text
WithUIConstructor(
// select a UI based on the logging configuration and state of stdin (if stdin is a tty)
func(cfg clio.Config) ([]clio.UI, error) {
func(cfg clio.Config) (*clio.UICollection, error) {
noUI := ui.None(out, cfg.Log.Quiet)
if !cfg.Log.AllowUI(os.Stdin) || cfg.Log.Quiet {
return []clio.UI{noUI}, nil
return clio.NewUICollection(noUI), nil
}
return []clio.UI{
return clio.NewUICollection(
ui.New(out, cfg.Log.Quiet,
ui2.New(ui2.DefaultHandlerConfig()),
),
noUI,
}, nil
), nil
},
).
WithInitializers(