diff --git a/test b/test deleted file mode 100755 index c63c8ce..0000000 --- a/test +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh - -if [[ $1 -eq 1 ]]; then - -echo "SETTITLE title -SETPROMPT prompt -SETDESC PROMPT -GETPIN -BYE" | ./pinentry-dmenu - -elif [[ $1 -eq 2 ]]; then - -echo "SETTITLE title -SETPROMPT confirm -SETDESC CONFIRM -confirm -BYE" | ./pinentry-dmenu - -elif [[ $1 -eq 3 ]]; then - -echo "SETTITLE title -SETPROMPT prompt -SETDESC REPEAT -SETREPEAT repeat -GETPIN -BYE" | ./pinentry-dmenu - -else - -echo "SETTITLE title -SETPROMPT prompt -SETDESC PROMPT -GETPIN -SETPROMPT confirm -SETDESC CONFIRM -confirm -SETPROMPT repeat -SETDESC REPEAT -SETREPEAT -GETPIN -BYE" | ./pinentry-dmenu - -fi diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..05fed5b --- /dev/null +++ b/test.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +prompt="SETTITLE title +SETPROMPT prompt +SETDESC PROMPT +GETPIN" + +confirm="SETTITLE title +SETPROMPT confirm +SETDESC CONFIRM +confirm" + +repeat="SETTITLE title +SETPROMPT prompt +SETDESC REPEAT +SETREPEAT repeat +GETPIN" + +case $1 in + 1) + printf "%s\nBYE" "$prompt" \ + | ./pinentry-dmenu + ;; + 2) + printf "%s\nBYE" "$confirm" \ + | ./pinentry-dmenu + ;; + 3) + printf "%s\nBYE" "$repeat" \ + | ./pinentry-dmenu + ;; + *) + printf "%s\n%s\n%s\nBYE" "$prompt" "$confirm" "$repeat" \ + | ./pinentry-dmenu + ;; +esac