MCPcopy Create free account
hub / github.com/basecamp/hey-cli / Execute

Function Execute

internal/cmd/root.go:145–163  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

143}
144
145func Execute() {
146 root := newRootCmd()
147
148 err := root.Execute()
149 if err != nil {
150 err = normalizeCobraError(err)
151 if writer == nil {
152 writer = output.New(output.Options{
153 Format: output.FormatFromFlags(jsonFlag, quietFlag, idsOnly, countFlag, markdownF, styledFlag, agentFlag),
154 })
155 }
156 if writer.IsStyled() && strings.HasPrefix(err.Error(), "Usage:") {
157 fmt.Fprintln(os.Stderr, err.Error())
158 os.Exit(output.ExitCodeFor(err))
159 }
160 writer.Err(err)
161 os.Exit(output.ExitCodeFor(err))
162 }
163}
164
165func requireAuth() error {
166 if !authMgr.IsAuthenticated() {

Callers 1

mainFunction · 0.92

Calls 8

NewFunction · 0.92
FormatFromFlagsFunction · 0.92
ExitCodeForFunction · 0.92
newRootCmdFunction · 0.85
normalizeCobraErrorFunction · 0.85
IsStyledMethod · 0.80
ErrMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected