mirror of
https://github.com/charmbracelet/gum
synced 2024-06-01 21:32:15 +02:00
test: add default gum
commands without any flags as test cases
This commit is contained in:
parent
4cb290e596
commit
5d24ca88f4
|
@ -1,8 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Choose
|
# Choose
|
||||||
gum choose Choose One Item --cursor "* " --cursor.foreground 99 --selected.foreground 99
|
|
||||||
gum choose Foo Bar Baz
|
gum choose Foo Bar Baz
|
||||||
|
gum choose Choose One Item --cursor "* " --cursor.foreground 99 --selected.foreground 99
|
||||||
gum choose Pick Two Items Maximum --limit 2 --cursor "* " --cursor-prefix "(•) " --selected-prefix "(x) " --unselected-prefix "( ) " --cursor.foreground 99 --selected.foreground 99
|
gum choose Pick Two Items Maximum --limit 2 --cursor "* " --cursor-prefix "(•) " --selected-prefix "(x) " --unselected-prefix "( ) " --cursor.foreground 99 --selected.foreground 99
|
||||||
gum choose Unlimited Choice Of Items --no-limit --cursor "* " --cursor-prefix "(•) " --selected-prefix "(x) " --unselected-prefix "( ) " --cursor.foreground 99 --selected.foreground 99
|
gum choose Unlimited Choice Of Items --no-limit --cursor "* " --cursor-prefix "(•) " --selected-prefix "(x) " --unselected-prefix "( ) " --cursor.foreground 99 --selected.foreground 99
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ gum confirm "Testing?"
|
||||||
gum confirm "No?" --default=false --affirmative "Okay." --negative "Cancel."
|
gum confirm "No?" --default=false --affirmative "Okay." --negative "Cancel."
|
||||||
|
|
||||||
# Filter
|
# Filter
|
||||||
|
gum filter
|
||||||
echo {1..500} | sed 's/ /\n/g' | gum filter
|
echo {1..500} | sed 's/ /\n/g' | gum filter
|
||||||
echo {1..500} | sed 's/ /\n/g' | gum filter --indicator ">" --placeholder "Pick a number..." --indicator.foreground 1 --text.foreground 2 --match.foreground 3 --prompt.foreground 4 --height 5
|
echo {1..500} | sed 's/ /\n/g' | gum filter --indicator ">" --placeholder "Pick a number..." --indicator.foreground 1 --text.foreground 2 --match.foreground 3 --prompt.foreground 4 --height 5
|
||||||
|
|
||||||
|
@ -21,6 +22,7 @@ echo ":candy:" | gum format -t emoji
|
||||||
echo '{{ Bold "Bold" }}' | gum format -t template
|
echo '{{ Bold "Bold" }}' | gum format -t template
|
||||||
|
|
||||||
# Input
|
# Input
|
||||||
|
gum input
|
||||||
gum input --prompt "Email: " --placeholder "john@doe.com" --prompt.foreground 99 --cursor.foreground 99 --width 50
|
gum input --prompt "Email: " --placeholder "john@doe.com" --prompt.foreground 99 --cursor.foreground 99 --width 50
|
||||||
gum input --password --prompt "Password: " --placeholder "hunter2" --prompt.foreground 99 --cursor.foreground 99 --width 50
|
gum input --password --prompt "Password: " --placeholder "hunter2" --prompt.foreground 99 --cursor.foreground 99 --width 50
|
||||||
|
|
||||||
|
@ -29,6 +31,7 @@ gum join "Horizontal" "Join"
|
||||||
gum join --vertical "Vertical" "Join"
|
gum join --vertical "Vertical" "Join"
|
||||||
|
|
||||||
# Spin
|
# Spin
|
||||||
|
gum spin -- sleep 1
|
||||||
gum spin --spinner minidot --title "Loading..." --title.foreground 99 -- sleep 1
|
gum spin --spinner minidot --title "Loading..." --title.foreground 99 -- sleep 1
|
||||||
gum spin --show-output --spinner monkey --title "Loading..." --title.foreground 99 -- sh -c 'sleep 1; echo "Hello, Gum!"'
|
gum spin --show-output --spinner monkey --title "Loading..." --title.foreground 99 -- sh -c 'sleep 1; echo "Hello, Gum!"'
|
||||||
|
|
||||||
|
@ -36,4 +39,5 @@ gum spin --show-output --spinner monkey --title "Loading..." --title.foreground
|
||||||
gum style --foreground 99 --border double --border-foreground 99 --padding "1 2" --margin 1 "Hello, Gum."
|
gum style --foreground 99 --border double --border-foreground 99 --padding "1 2" --margin 1 "Hello, Gum."
|
||||||
|
|
||||||
# Write
|
# Write
|
||||||
|
gum write
|
||||||
gum write --width 40 --height 3 --placeholder "Type whatever you want" --prompt "| " --show-cursor-line --show-line-numbers --value "Something..." --base.padding 1 --cursor.foreground 99 --prompt.foreground 99
|
gum write --width 40 --height 3 --placeholder "Type whatever you want" --prompt "| " --show-cursor-line --show-line-numbers --value "Something..." --base.padding 1 --cursor.foreground 99 --prompt.foreground 99
|
||||||
|
|
Loading…
Reference in a new issue