jpictl: introduce write command rewriting all config files

Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
2023-08-25 21:20:34 +00:00
parent 26c49dff72
commit dfbb358187
2 changed files with 56 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
package main
import (
"github.com/spf13/cobra"
)
// Command
var writeCmd = &cobra.Command{
Use: "write",
Short: "rewrites all config files",
RunE: func(_ *cobra.Command, _ []string) error {
m, err := cfg.LoadZones()
if err != nil {
return err
}
return m.SyncAll()
},
}
func init() {
rootCmd.AddCommand(writeCmd)
}