Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
hirenko-v authored Sep 23, 2024
1 parent 7707e05 commit 559ed3e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions cmd/msg/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,15 +262,11 @@ func showBothSelects(state map[string]string) executor.ExecuteOutput {
// Create multiple dropdowns based on the options in the script output
for _, option := range scriptOutput.Options {
// Skip the help options (-h, --help)
if option.Flags[0] == "-h" {
continue
}

// Construct the flag key for the state
flagKey := fmt.Sprintf("%s-%s", state["first"], option.Flags[0])

if option.Type == "bool" || option.Type == "dropdown" {

// Construct the flag key for the state
flagKey := fmt.Sprintf("%s-%s", state["first"], option.Flags[0])

var dropdownOptions []api.OptionItem
boolValues := []string{"true", "false"}
values := option.Values; if option.Type == "bool" { values = boolValues }
Expand Down Expand Up @@ -310,7 +306,10 @@ func showBothSelects(state map[string]string) executor.ExecuteOutput {
InitialOption: initialOption,
})
}
}
for _, option := range scriptOutput.Options {
if option.Type == "text" {
flagKey := fmt.Sprintf("%s-%s", state["first"], option.Flags[0])
sections[0].PlaintextInputs = append(sections[0].PlaintextInputs, api.LabelInput{
Command: cmdPrefix(fmt.Sprintf("select_dynamic %s %s ", flagKey, option.Flags[0])),
Text: option.Description,
Expand Down

0 comments on commit 559ed3e

Please sign in to comment.