()
| 24 | } |
| 25 | |
| 26 | func init() { |
| 27 | Conv.Cmd = &cobra.Command{ |
| 28 | Use: "conv", |
| 29 | Short: "Dgraph Geo file converter", |
| 30 | Args: cobra.NoArgs, |
| 31 | Run: func(cmd *cobra.Command, args []string) { |
| 32 | defer x.StartProfile(Conv.Conf).Stop() |
| 33 | if err := run(); err != nil { |
| 34 | fmt.Println(err) |
| 35 | os.Exit(1) |
| 36 | } |
| 37 | }, |
| 38 | Annotations: map[string]string{"group": "tool"}, |
| 39 | } |
| 40 | Conv.Cmd.SetHelpTemplate(x.NonRootTemplate) |
| 41 | |
| 42 | flag := Conv.Cmd.Flags() |
| 43 | flag.StringVar(&opt.geo, "geo", "", "Location of geo file to convert") |
| 44 | flag.StringVar(&opt.out, "out", "output.rdf.gz", "Location of output rdf.gz file") |
| 45 | flag.StringVar(&opt.geopred, "geopred", "loc", "Predicate to use to store geometries") |
| 46 | x.Check(Conv.Cmd.MarkFlagRequired("geo")) |
| 47 | } |
| 48 | |
| 49 | func run() error { |
| 50 | return convertGeoFile(opt.geo, opt.out) |
nothing calls this directly
no test coverage detected