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

Function Execute

dgraph/cmd/root.go:64–75  ·  view source on GitHub ↗

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

()

Source from the content-addressed store, hash-verified

62// Execute adds all child commands to the root command and sets flags appropriately.
63// This is called by main.main(). It only needs to happen once to the rootCmd.
64func Execute() {
65 initCmds()
66
67 // Convinces glog that Parse() has been called to avoid noisy logs.
68 // https://github.com/kubernetes/kubernetes/issues/17162#issuecomment-225596212
69 x.Check(flag.CommandLine.Parse([]string{}))
70
71 // Dumping the usage in case of an error makes the error messages harder to see.
72 RootCmd.SilenceUsage = true
73
74 x.CheckfNoLog(RootCmd.Execute())
75}
76
77var rootConf = viper.New()
78

Callers 1

mainFunction · 0.92

Calls 5

CheckFunction · 0.92
CheckfNoLogFunction · 0.92
initCmdsFunction · 0.85
ParseMethod · 0.65
ExecuteMethod · 0.65

Tested by

no test coverage detected