Documentation
¶
Overview ¶
Package prompts provides interactive terminal prompts for CLI commands.
Index ¶
- func PrintResult(fields []ResultField, successMsg string)
- func RunConnectionsAddForm(name, connType, host, description *string, ...) error
- func RunConnectionsDescribeForm(value *string, connections map[string]opendpi.Connection) error
- func RunInitForm(name, version, description *string) error
- func RunPortsAddForm(name, description, connection, location *string, ...) error
- func RunPortsDescribeForm(value *string, ports map[string]opendpi.Port) error
- func RunTranslateForm(selectedPorts *[]string, format *string, outputDir *string, ...) error
- func Theme() *huh.Theme
- type ResultField
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintResult ¶ added in v0.2.0
func PrintResult(fields []ResultField, successMsg string)
PrintResult prints a styled summary with green checkmarks and gray labels.
func RunConnectionsAddForm ¶ added in v0.2.0
func RunConnectionsAddForm( name, connType, host, description *string, existingConns map[string]opendpi.Connection, ) error
RunConnectionsAddForm runs the interactive form for creating a new connection.
func RunConnectionsDescribeForm ¶ added in v0.2.0
func RunConnectionsDescribeForm(value *string, connections map[string]opendpi.Connection) error
RunConnectionsDescribeForm prompts the user to select a connection to describe.
func RunInitForm ¶
RunInitForm runs the interactive form for the init command.
func RunPortsAddForm ¶ added in v0.2.0
func RunPortsAddForm( name, description, connection, location *string, existingPorts map[string]opendpi.Port, existingConns map[string]opendpi.Connection, ) error
RunPortsAddForm runs the interactive form for adding a port. It fills the provided pointers with user input.
func RunPortsDescribeForm ¶ added in v0.2.0
RunPortsDescribeForm prompts the user to select a port to describe.
func RunTranslateForm ¶ added in v0.2.0
func RunTranslateForm( selectedPorts *[]string, format *string, outputDir *string, promptOutputDir bool, ports map[string]opendpi.Port, formats []string, ) error
RunTranslateForm runs the interactive form for translating ports. It only prompts for fields that are not already set:
- selectedPorts: if empty, prompts with a multi-select of available ports
- format: if empty, prompts with a select of available formats
- outputDir: if promptOutputDir is true, prompts with a text input
Types ¶
type ResultField ¶ added in v0.2.0
ResultField is a label-value pair for PrintResult.