Skip to content

Commit

Permalink
examples: fixed interactive_multiselect examples (#606)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvinJWendt committed Jan 3, 2024
1 parent 65c1b1e commit 418f05c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
5 changes: 0 additions & 5 deletions _examples/interactive_multiselect/custom-checkmarks/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ func init() {

time.Sleep(time.Second)

for i := 0; i < 2; i++ {
keyboard.SimulateKeyPress(keys.Down)
time.Sleep(time.Millisecond * 300)
}

keyboard.SimulateKeyPress(keys.Enter)
time.Sleep(time.Millisecond * 350)
keyboard.SimulateKeyPress(keys.Tab)
Expand Down
5 changes: 1 addition & 4 deletions _examples/interactive_multiselect/custom-checkmarks/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"atomicgo.dev/keyboard/keys"
"fmt"
"github.com/pterm/pterm"
)
Expand All @@ -16,12 +15,10 @@ func main() {
}

// Create a new interactive multiselect printer with the options
// Disable the filter, set the keys for confirming and selecting, and define the checkmark symbols
// Disable the filter and define the checkmark symbols
printer := pterm.DefaultInteractiveMultiselect.
WithOptions(options).
WithFilter(false).
WithKeyConfirm(keys.Enter).
WithKeySelect(keys.Space).
WithCheckmark(&pterm.Checkmark{Checked: pterm.Green("+"), Unchecked: pterm.Red("-")})

// Show the interactive multiselect and get the selected options
Expand Down

0 comments on commit 418f05c

Please sign in to comment.