MCPcopy
hub / github.com/dgraph-io/dgraph / init

Function init

dgraph/cmd/conv/run.go:26–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24}
25
26func 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
49func run() error {
50 return convertGeoFile(opt.geo, opt.out)

Callers

nothing calls this directly

Calls 4

StartProfileFunction · 0.92
CheckFunction · 0.92
runFunction · 0.70
StopMethod · 0.65

Tested by

no test coverage detected