mirror of
https://github.com/zrepl/zrepl.git
synced 2025-08-14 00:58:24 +02:00
add status command
This commit is contained in:
16
main.go
16
main.go
@ -5,6 +5,7 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/zrepl/zrepl/config"
|
||||
"github.com/zrepl/zrepl/daemon"
|
||||
"github.com/zrepl/zrepl/client"
|
||||
"log"
|
||||
"os"
|
||||
)
|
||||
@ -40,7 +41,19 @@ var wakeupCmd = &cobra.Command{
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return RunWakeup(conf, args)
|
||||
return client.RunWakeup(conf, args)
|
||||
},
|
||||
}
|
||||
|
||||
var statusCmd = &cobra.Command{
|
||||
Use: "status",
|
||||
Short: "status",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
conf, err := config.ParseConfig(rootArgs.configFile)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return client.RunStatus(conf, args)
|
||||
},
|
||||
}
|
||||
|
||||
@ -53,6 +66,7 @@ func init() {
|
||||
rootCmd.PersistentFlags().StringVar(&rootArgs.configFile, "config", "", "config file path")
|
||||
rootCmd.AddCommand(daemonCmd)
|
||||
rootCmd.AddCommand(wakeupCmd)
|
||||
rootCmd.AddCommand(statusCmd)
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
Reference in New Issue
Block a user