2019-01-06 06:44:33 +08:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
configCmd.AddCommand(configCatCmd)
|
|
|
|
}
|
|
|
|
|
|
|
|
var configCatCmd = &cobra.Command{
|
|
|
|
Use: "cat",
|
|
|
|
Short: "Prints the configuration",
|
|
|
|
Long: `Prints the configuration.`,
|
|
|
|
Args: cobra.NoArgs,
|
2019-01-08 04:24:23 +08:00
|
|
|
Run: python(func(cmd *cobra.Command, args []string, d pythonData) {
|
2019-01-08 22:07:55 +08:00
|
|
|
set, err := d.store.Settings.Get()
|
2019-01-06 06:44:33 +08:00
|
|
|
checkErr(err)
|
2019-01-08 22:07:55 +08:00
|
|
|
ser, err := d.store.Settings.GetServer()
|
2019-01-06 06:44:33 +08:00
|
|
|
checkErr(err)
|
2019-01-08 22:07:55 +08:00
|
|
|
auther, err := d.store.Auth.Get(set.AuthMethod)
|
|
|
|
checkErr(err)
|
|
|
|
printSettings(ser, set, auther)
|
2019-01-08 04:24:23 +08:00
|
|
|
}, pythonConfig{}),
|
2019-01-06 06:44:33 +08:00
|
|
|
}
|