MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / PrepareBaseCmd

Function PrepareBaseCmd

libs/cli/setup.go:28–34  ·  view source on GitHub ↗

PrepareBaseCmd is meant for tendermint and other servers

(cmd *cobra.Command, envPrefix, defaultHome string)

Source from the content-addressed store, hash-verified

26
27// PrepareBaseCmd is meant for tendermint and other servers
28func PrepareBaseCmd(cmd *cobra.Command, envPrefix, defaultHome string) Executor {
29 cobra.OnInitialize(func() { initEnv(envPrefix) })
30 cmd.PersistentFlags().StringP(HomeFlag, "", defaultHome, "directory for config and data")
31 cmd.PersistentFlags().Bool(TraceFlag, false, "print out full stack trace on errors")
32 cmd.PersistentPreRunE = concatCobraCmdFuncs(bindFlagsLoadViper, cmd.PersistentPreRunE)
33 return Executor{cmd, os.Exit}
34}
35
36// PrepareMainCmd is meant for client side libs that want some more flags
37//

Callers 9

mainFunction · 0.92
mainFunction · 0.92
testSetupFunction · 0.92
TestRootConfigFunction · 0.92
PrepareMainCmdFunction · 0.85
TestSetupEnvFunction · 0.85
TestSetupConfigFunction · 0.85
TestSetupUnmarshalFunction · 0.85
TestSetupTraceFunction · 0.85

Calls 3

initEnvFunction · 0.85
concatCobraCmdFuncsFunction · 0.85
BoolMethod · 0.80

Tested by 6

testSetupFunction · 0.74
TestRootConfigFunction · 0.74
TestSetupEnvFunction · 0.68
TestSetupConfigFunction · 0.68
TestSetupUnmarshalFunction · 0.68
TestSetupTraceFunction · 0.68