26 lines
558 B
Go
26 lines
558 B
Go
package cmd
|
|
|
|
import (
|
|
"esgo2dump/internal/opt"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var (
|
|
rootCommand = &cobra.Command{
|
|
Use: "esgo2dump",
|
|
Short: "esgo2dump is alternative to elasticdump",
|
|
RunE: run,
|
|
}
|
|
|
|
input string
|
|
output string
|
|
limit int
|
|
)
|
|
|
|
func initRootCommand() {
|
|
rootCommand.Flags().BoolVar(&opt.Debug, "debug", false, "")
|
|
rootCommand.Flags().StringVarP(&input, "input", "i", "https://127.0.0.1:9200", "")
|
|
rootCommand.Flags().StringVarP(&output, "output", "o", "output.json", "")
|
|
rootCommand.Flags().IntVarP(&limit, "limit", "l", 100, "")
|
|
}
|