gcr/fixtures/gnupg-mock/mock-status-and-output
raw| 1 | #!/bin/sh |
| 2 | |
| 3 | # This script is used with test-gnupg-process |
| 4 | set -euf |
| 5 | |
| 6 | FD= |
| 7 | |
| 8 | # Not real 'long' option parsing, but good enough for this |
| 9 | while [ $# -gt 1 ]; do |
| 10 | if [ "$1" = --status-fd ]; then |
| 11 | FD=$2 |
| 12 | shift |
| 13 | fi |
| 14 | shift |
| 15 | done |
| 16 | |
| 17 | # No FD passed :( |
| 18 | if [ -z "$FD" ]; then |
| 19 | exit 22 |
| 20 | fi |
| 21 | |
| 22 | echo "Here's some output" |
| 23 | echo "[GNUPG:] SCHEMA one two three four " >&$FD |
| 24 | echo "More output" |