zrepl/cmd/main.go

48 lines
1.1 KiB
Go
Raw Normal View History

// zrepl replicates ZFS filesystems & volumes between pools
//
// Code Organization
//
// The cmd package uses github.com/spf13/cobra for its CLI.
//
// It combines the other packages in the zrepl project to implement zrepl functionality.
//
// Each subcommand's code is in the corresponding *.go file.
// All other *.go files contain code shared by the subcommands.
package cmd
2017-04-14 19:26:32 +02:00
2017-04-26 20:21:18 +02:00
import (
"github.com/spf13/cobra"
"github.com/zrepl/zrepl/logger"
2017-04-26 20:21:18 +02:00
)
2017-09-22 14:13:58 +02:00
//
//type Logger interface {
// Printf(format string, v ...interface{})
//}
var (
zreplVersion string // set by build infrastructure
)
2018-08-10 17:06:00 +02:00
type Logger = logger.Logger
var RootCmd = &cobra.Command{
Use: "zrepl",
Short: "ZFS dataset replication",
Long: `Replicate ZFS filesystems & volumes between pools:
2017-04-14 19:26:32 +02:00
- push & pull mode
- automatic snapshot creation & pruning
- local / over the network
- ACLs instead of blank SSH access`,
2017-04-26 20:21:18 +02:00
}
2017-04-14 19:26:32 +02:00
var rootArgs struct {
configFile string
2017-04-14 19:26:32 +02:00
}
func init() {
//cobra.OnInitialize(initConfig)
RootCmd.PersistentFlags().StringVar(&rootArgs.configFile, "config", "", "config file path")
}