#!/bin/sh

# This script is used with test-gnupg-process
set -euf

FD=

# Not real 'long' option parsing, but good enough for this
while [ $# -gt 1 ]; do
	if [ "$1" = --status-fd ]; then
		FD=$2
		shift
	fi
	shift
done

# No FD passed :(
if [ -z "$FD" ]; then
	exit 22
fi

echo "Here's some output"
echo "[GNUPG:] SCHEMA one two three four " >&$FD
echo "More output"
