add status command

This commit is contained in:
Anton Schirg
2018-08-29 19:18:54 +02:00
parent e495824834
commit 6cedd0a2e8
5 changed files with 277 additions and 4 deletions

16
main.go
View File

@ -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() {