filebrowser/cmd/config_cat.go
Henrique Dias 4744dc3f75 feat: new user api and quick setup
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
2018-12-31 16:03:36 +00:00

27 lines
505 B
Go

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,
Run: func(cmd *cobra.Command, args []string) {
db := getDB()
defer db.Close()
st := getStore(db)
s, err := st.Config.GetSettings()
checkErr(err)
auther, err := st.Config.GetAuther(s.AuthMethod)
checkErr(err)
printSettings(s, auther)
},
}