MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / formatCommandResult

Function formatCommandResult

internal/ui/plugins/ansible/plugin.go:2741–2756  ·  view source on GitHub ↗
(result coreansible.CommandResult)

Source from the content-addressed store, hash-verified

2739}
2740
2741func formatCommandResult(result coreansible.CommandResult) string {
2742 var b strings.Builder
2743
2744 b.WriteString("Command:\n")
2745 b.WriteString(result.Command)
2746 b.WriteString("\n\nDuration: ")
2747 b.WriteString(result.Duration.String())
2748 if result.Err != nil {
2749 b.WriteString("\nError: ")
2750 b.WriteString(result.Err.Error())
2751 }
2752 b.WriteString("\n\nOutput:\n")
2753 b.WriteString(result.Output)
2754
2755 return b.String()
2756}
2757
2758func (p *Plugin) centerModal(content tview.Primitive, width, height int) tview.Primitive {
2759 screenW, screenH := 120, 40

Callers 4

runAdhocMethod · 0.85
runPlaybookMethod · 0.85
runBootstrapAccessMethod · 0.85
previewInventoryMethod · 0.85

Calls 2

ErrorMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected