gosuki/cmd/config_commands.go

35 lines
530 B
Go
Raw Normal View History

2019-02-28 17:16:22 +00:00
package cmd
import (
"gomark/config"
"gomark/logging"
"gomark/utils"
cli "gopkg.in/urfave/cli.v1"
)
var log = logging.GetLogger("CMD")
var cfgPrintCmd = cli.Command{
Name: "print",
Aliases: []string{"p"},
Usage: "print current config",
Action: printConfig,
}
var ConfigCmds = cli.Command{
Name: "config",
Usage: "get/set config opetions",
Subcommands: []cli.Command{
cfgPrintCmd,
},
}
func printConfig(c *cli.Context) {
err := utils.PrettyPrint(config.GetAll())
if err != nil {
log.Fatal(err)
}
}