gosuki/cmd/config_commands.go

33 lines
557 B
Go
Raw Normal View History

2019-02-28 17:16:22 +00:00
package cmd
import (
2023-02-18 23:13:23 +00:00
"git.blob42.xyz/gomark/gosuki/config"
"git.blob42.xyz/gomark/gosuki/logging"
2019-02-28 17:16:22 +00:00
"github.com/kr/pretty"
2020-08-12 18:13:01 +00:00
"github.com/urfave/cli/v2"
2019-02-28 17:16:22 +00:00
)
var log = logging.GetLogger("CMD")
var cfgPrintCmd = &cli.Command{
2019-02-28 17:16:22 +00:00
Name: "print",
Aliases: []string{"p"},
Usage: "print current config",
Action: printConfig,
}
var ConfigCmds = &cli.Command{
2019-02-28 17:16:22 +00:00
Name: "config",
Usage: "get/set config opetions",
Subcommands: []*cli.Command{
2019-02-28 17:16:22 +00:00
cfgPrintCmd,
},
}
2023-09-05 17:45:21 +00:00
func printConfig(_ *cli.Context) error {
pretty.Println(config.GetAll())
return nil
2019-02-28 17:16:22 +00:00
}