Skip to content
Snippets Groups Projects
Commit ee15449b authored by Simon Oehrl's avatar Simon Oehrl
Browse files

Use arrows for selecting branches

parent 6c4021a4
No related branches found
No related tags found
No related merge requests found
...@@ -112,7 +112,7 @@ function manage_plugins() { ...@@ -112,7 +112,7 @@ function manage_plugins() {
fi fi
done done
function toggle_branch() { function next_branch() {
case ${plugin_branches[$1]} in case ${plugin_branches[$1]} in
"") plugin_branches[$1]="master" ;; "") plugin_branches[$1]="master" ;;
"master") plugin_branches[$1]="develop" ;; "master") plugin_branches[$1]="develop" ;;
...@@ -121,6 +121,15 @@ function manage_plugins() { ...@@ -121,6 +121,15 @@ function manage_plugins() {
esac esac
} }
function previous_branch() {
case ${plugin_branches[$1]} in
"master") plugin_branches[$1]="" ;;
"develop") plugin_branches[$1]="master" ;;
"") plugin_branches[$1]="develop" ;;
*) >&2; plugin_branches[$1]="" ;;
esac
}
selection=0 selection=0
exit=false exit=false
cancel=false cancel=false
...@@ -157,7 +166,7 @@ function manage_plugins() { ...@@ -157,7 +166,7 @@ function manage_plugins() {
echo "" echo ""
echo "[Arrow Up/Down] Select Plugin" echo "[Arrow Up/Down] Select Plugin"
echo "[Space] Toggle branch" echo "[Arrow Left/Right] Select branch"
echo "[Enter] Continue" echo "[Enter] Continue"
echo "[Esc] Cancel" echo "[Esc] Cancel"
...@@ -173,7 +182,8 @@ function manage_plugins() { ...@@ -173,7 +182,8 @@ function manage_plugins() {
IFS=$SAVEIFS IFS=$SAVEIFS
case $mode in case $mode in
"") if [ "$escape" == true ]; then cancel=true; fi; exit=true ;; "") if [ "$escape" == true ]; then cancel=true; fi; exit=true ;;
" ") toggle_branch $selection ;; "[D") previous_branch $selection ;;
"[C") next_branch $selection ;;
"[A") if [ "$selection" -gt "0" ]; then let selection-=1; fi ;; "[A") if [ "$selection" -gt "0" ]; then let selection-=1; fi ;;
"[B") if [ "$selection" -lt "$num_plugins_minus_one" ]; then let selection+=1; fi ;; "[B") if [ "$selection" -lt "$num_plugins_minus_one" ]; then let selection+=1; fi ;;
*) >&2 ;; *) >&2 ;;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment