MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / Run

Method Run

internal/cli/app.go:50–67  ·  view source on GitHub ↗

Run executes the CLI and returns the process exit code. errEndpointsHandled from PersistentPreRunE is translated to a successful exit so the global --endpoints short-circuit behaves identically to Python's typer.Exit().

(args []string)

Source from the content-addressed store, hash-verified

48// from PersistentPreRunE is translated to a successful exit so the global
49// --endpoints short-circuit behaves identically to Python's typer.Exit().
50func (a *App) Run(args []string) int {
51 cmd := a.rootCommand()
52 cmd.SetArgs(args)
53 cmd.SetOut(a.stdout)
54 cmd.SetErr(a.stderr)
55 cmd.SetIn(a.stdin)
56 cmd.SilenceUsage = true
57 cmd.SilenceErrors = true
58
59 if err := cmd.Execute(); err != nil {
60 if errors.Is(err, errEndpointsHandled) {
61 return 0
62 }
63 fmt.Fprintln(a.stderr, err.Error())
64 return 1
65 }
66 return 0
67}
68
69func (a *App) rootCommand() *cobra.Command {
70 state := &globalState{}

Callers

nothing calls this directly

Calls 2

rootCommandMethod · 0.95
ErrorMethod · 0.45

Tested by

no test coverage detected