Route help and version through the reporter
This commit is contained in:
@@ -166,7 +166,7 @@ func (current *execution) renderHelp(path []string) Outcome {
|
||||
}
|
||||
session := current.presentationSession()
|
||||
view := current.app.helpView(current.route, current.snapshot)
|
||||
return current.app.renderHelpViewOutcomeWithSession(view, current.streams, session)
|
||||
return current.app.renderHelpViewOutcomeWithSession(view, current.reporter, session)
|
||||
}
|
||||
|
||||
func (current *execution) renderHelpTargets(targets []string) Outcome {
|
||||
@@ -184,7 +184,8 @@ func (current *execution) renderHelpTargets(targets []string) Outcome {
|
||||
// Discovery routes have no canonical path and retain only trailing options.
|
||||
if route.kind == routeUnknown || len(route.args) != len(route.canonicalPath) {
|
||||
session := internalcobra.Prepare(snapshot.metadata, current.options)
|
||||
return current.app.renderHelpOutcomeWithSession(targets, current.streams, session)
|
||||
view := commandmeta.HelpView{EnteredPath: targets, CanonicalPath: targets}
|
||||
return current.app.renderHelpViewOutcomeWithSession(view, current.reporter, session)
|
||||
}
|
||||
options := current.options
|
||||
switch route.kind {
|
||||
@@ -195,7 +196,7 @@ func (current *execution) renderHelpTargets(targets []string) Outcome {
|
||||
}
|
||||
session := internalcobra.Prepare(snapshot.metadata, options)
|
||||
view := current.app.helpView(route, snapshot)
|
||||
return current.app.renderHelpViewOutcomeWithSession(view, current.streams, session)
|
||||
return current.app.renderHelpViewOutcomeWithSession(view, current.reporter, session)
|
||||
}
|
||||
|
||||
func (current *execution) usageLine(path []string) string {
|
||||
|
||||
Reference in New Issue
Block a user