. "$KEYSLIB"/keyfunc.sh
defhelp <<HELP
-RECOV LABEL
+[-i INST] RECOV LABEL
Recover the secret LABEL using recovery key RECOV.
The recovery key must be revealed. The secret is written to stdout.
HELP
## Parse the command line.
+inst=current
+while getopts "i:" opt; do
+ case "$opt" in
+ i) inst=$OPTARG ;;
+ *) usage_err ;;
+ esac
+done
+shift $(( $OPTIND - 1 ))
case $# in 2) ;; *) usage_err ;; esac
recov=$1 label=$2
-checklabel "recovery key label" "$recov"
+checkword "recovery instance" "$inst"
+checkword "recovery key label" "$recov"
checklabel "secret" "$label"
## Do the recovery.
-recover $recov $label
+recover $recov $inst $label
###----- That's all, folks --------------------------------------------------