12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- package sub
- import (
- "fmt"
- "os"
- "github.com/fatedier/frp/pkg/config"
- "github.com/spf13/cobra"
- )
- func init() {
- rootCmd.AddCommand(verifyCmd)
- }
- var verifyCmd = &cobra.Command{
- Use: "verify",
- Short: "Verify that the configures is valid",
- RunE: func(cmd *cobra.Command, args []string) error {
- _, _, _, err := config.ParseClientConfig(cfgFile)
- if err != nil {
- fmt.Println(err)
- os.Exit(1)
- }
- fmt.Printf("frpc: the configuration file %s syntax is ok\n", cfgFile)
- return nil
- },
- }
|