Config to string, JSON and YAML methods added and updated print methods to use new methods

This commit is contained in:
bwilliams committed 2026-09-29 11:55:11 +01:00
1 parent e715024cbd
commit a0fad30e99
3 files changed
+32 -33

No files matched your search

+2 -20
View File
@@ -27,26 +27,8 @@ import (
func commandGet() *cobra.Command {
cmd := &cobra.Command{
Use: "get [config_key]",
Args: cobra.ExactArgs(1),
// Args: func(cmd *cobra.Command, args []string) error {
// // Optionally run one of the validators provided by cobra
// if err := cobra.ExactArgs(1)(cmd, args); err != nil {
// return err
// }
// conf, ok := cli.ConfigFromContext(cmd.Context())
// if !ok {
// return errors.New("no configuration loaded")
// }
// flatConf := config.FlattenConfig(conf)
// if !util.HasKey(flatConf, args[0]) {
// return fmt.Errorf("invalid config key specified: %s", args[0])
// }
// return nil
// },
Use: "get [config_key]",
Args: cobra.ExactArgs(1),
Short: "Get a value from configuration",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
slog.Debug("config.get.PersistentPreRun")