2019-02-28 17:16:22 +00:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
2023-09-09 23:14:13 +00:00
|
|
|
"git.blob42.xyz/gomark/gosuki/internal/config"
|
|
|
|
"git.blob42.xyz/gomark/gosuki/internal/logging"
|
2019-02-28 17:16:22 +00:00
|
|
|
|
2022-11-21 23:05:24 +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")
|
|
|
|
|
2020-08-12 19:11:48 +00:00
|
|
|
var cfgPrintCmd = &cli.Command{
|
2019-02-28 17:16:22 +00:00
|
|
|
Name: "print",
|
|
|
|
Aliases: []string{"p"},
|
|
|
|
Usage: "print current config",
|
|
|
|
Action: printConfig,
|
|
|
|
}
|
|
|
|
|
2020-08-12 19:11:48 +00:00
|
|
|
var ConfigCmds = &cli.Command{
|
2019-02-28 17:16:22 +00:00
|
|
|
Name: "config",
|
|
|
|
Usage: "get/set config opetions",
|
2020-08-12 19:11:48 +00:00
|
|
|
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 {
|
2022-11-21 23:05:24 +00:00
|
|
|
pretty.Println(config.GetAll())
|
2020-08-12 19:11:48 +00:00
|
|
|
|
2022-11-21 23:05:24 +00:00
|
|
|
return nil
|
2019-02-28 17:16:22 +00:00
|
|
|
}
|