MCPcopy
hub / github.com/canopy-network/canopy / init

Function init

cmd/cli/cli.go:47–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

45)
46
47func init() {
48 flag.Parse()
49 rootCmd.AddCommand(startCmd)
50 rootCmd.AddCommand(versionCmd)
51 rootCmd.AddCommand(queryCmd)
52 rootCmd.AddCommand(adminCmd)
53 rootCmd.AddCommand(autoCompleteCmd)
54 autoCompleteCmd.AddCommand(generateCompleteCmd)
55 autoCompleteCmd.AddCommand(autoCompleteInstallCmd)
56 rootCmd.PersistentFlags().StringVar(&DataDir, "data-dir", lib.DefaultDataDirPath(), "custom data directory location")
57 config, validatorKey = InitializeDataDirectory(DataDir, lib.NewDefaultLogger())
58 l = lib.NewLogger(lib.LoggerConfig{
59 Level: config.GetLogLevel(),
60 Structured: config.Structured,
61 JSON: config.JSON,
62 })
63 client = rpc.NewClient(config.RPCUrl, config.AdminRPCUrl)
64}
65
66func Execute() {
67 if err := rootCmd.Execute(); err != nil {

Callers

nothing calls this directly

Calls 6

DefaultDataDirPathFunction · 0.92
NewDefaultLoggerFunction · 0.92
NewLoggerFunction · 0.92
NewClientFunction · 0.92
InitializeDataDirectoryFunction · 0.85
GetLogLevelMethod · 0.80

Tested by

no test coverage detected