mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
35 lines
631 B
Go
35 lines
631 B
Go
package cmd
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/pilosa/pilosa/ctl"
|
|
)
|
|
|
|
var checker = ctl.NewCheckCommand(os.Stdin, os.Stdout, os.Stderr)
|
|
|
|
var checkCmd = &cobra.Command{
|
|
Use: "check <path> [path2]...",
|
|
Short: "Do a consistency check on a pilosa data file.",
|
|
Long: `
|
|
Performs a consistency check on data files.
|
|
`,
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
if len(args) == 0 {
|
|
fmt.Println("path required")
|
|
return
|
|
}
|
|
checker.Paths = args
|
|
if err := checker.Run(context.Background()); err != nil {
|
|
fmt.Println(err)
|
|
}
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
RootCmd.AddCommand(checkCmd)
|
|
}
|