mirror of https://github.com/synctv-org/synctv
Feat: add cmd conf
parent
29e06d7a23
commit
5fccea83f3
@ -1,11 +1,26 @@
|
||||
package cmd
|
||||
|
||||
import "github.com/spf13/cobra"
|
||||
|
||||
func ConfCmd() *cobra.Command {
|
||||
return &cobra.Command{
|
||||
Use: "conf",
|
||||
Short: "conf",
|
||||
Long: `config file`,
|
||||
}
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/synctv-org/synctv/internal/bootstrap"
|
||||
"github.com/synctv-org/synctv/internal/conf"
|
||||
)
|
||||
|
||||
var ConfCmd = &cobra.Command{
|
||||
Use: "conf",
|
||||
Short: "conf",
|
||||
Long: `config file`,
|
||||
RunE: Conf,
|
||||
}
|
||||
|
||||
func Conf(cmd *cobra.Command, args []string) error {
|
||||
bootstrap.InitConfig()
|
||||
fmt.Println(conf.Conf.String())
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
RootCmd.AddCommand(ConfCmd)
|
||||
}
|
||||
|
Loading…
Reference in New Issue