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

Method handleCommandSelection

internal/plugins/command-runner/ui.go:139–149  ·  view source on GitHub ↗

handleCommandSelection processes command selection and prompts for parameters if needed

(targetType TargetType, target, command string, onResultClosed func())

Source from the content-addressed store, hash-verified

137
138// handleCommandSelection processes command selection and prompts for parameters if needed
139func (u *UIManager) handleCommandSelection(targetType TargetType, target, command string, onResultClosed func()) {
140 template := ParseTemplate(command)
141
142 if len(template.Parameters) == 0 {
143 // No parameters, execute directly
144 u.executeAndShowResult(targetType, target, command, nil, onResultClosed)
145 } else {
146 // Has parameters, show input form
147 u.showParameterForm(targetType, target, command, template, onResultClosed)
148 }
149}
150
151// showParameterForm displays a form to collect parameter values
152func (u *UIManager) showParameterForm(targetType TargetType, target, command string, template CommandTemplate, onReturn func()) {

Callers 1

showCommandMenuMethod · 0.95

Calls 3

executeAndShowResultMethod · 0.95
showParameterFormMethod · 0.95
ParseTemplateFunction · 0.85

Tested by

no test coverage detected