mirror of
https://github.com/zrepl/zrepl.git
synced 2024-11-25 01:44:43 +01:00
add small subcommand to validate config
This commit is contained in:
parent
4b39a18178
commit
6c988d0ebb
8
client/configcheck.go
Normal file
8
client/configcheck.go
Normal file
@ -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
|
||||
}
|
13
main.go
13
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() {
|
||||
|
Loading…
Reference in New Issue
Block a user