diff --git a/client/configcheck.go b/client/configcheck.go new file mode 100644 index 0000000..b50ac80 --- /dev/null +++ b/client/configcheck.go @@ -0,0 +1,8 @@ +package client + +import "github.com/zrepl/zrepl/config" + +func RunConfigcheck(conf *config.Config, args []string) error { + // TODO: do the 'build' steps, e.g. build the jobs and see if that fails + return nil +} diff --git a/main.go b/main.go index 575ac86..905e2f1 100644 --- a/main.go +++ b/main.go @@ -88,6 +88,18 @@ var bashcompCmd = &cobra.Command{ Hidden: true, } +var configcheckCmd = &cobra.Command{ + Use: "configcheck", + Short: "validate config file", + RunE: func(cmd *cobra.Command, args []string) error { + conf, err := config.ParseConfig(rootArgs.configFile) + if err != nil { + return err + } + return client.RunConfigcheck(conf, args) + }, +} + var rootArgs struct { configFile string } @@ -100,6 +112,7 @@ func init() { rootCmd.AddCommand(statusCmd) rootCmd.AddCommand(stdinserverCmd) rootCmd.AddCommand(bashcompCmd) + rootCmd.AddCommand(configcheckCmd) } func main() {