xref: /freebsd/contrib/dialog/samples/report-edit (revision a96ef4501919d7ac08e94e98dc34b0bdd744802b)
1#!/bin/sh
2# $Id: report-edit,v 1.8 2020/11/26 00:18:32 tom Exp $
3# Report results from editing.
4# vile:shmode
5
6case ${returncode:-0} in
7  $DIALOG_OK)
8    diff -c "${input:-input}" "${output:-output}"
9    echo "OK"
10    ;;
11  $DIALOG_CANCEL)
12    echo "Cancel pressed";;
13  $DIALOG_HELP)
14    echo "Help pressed";;
15  $DIALOG_EXTRA)
16    echo "Extra pressed";;
17  $DIALOG_ITEM_HELP)
18    echo "Item-help button pressed.";;
19  $DIALOG_TIMEOUT)
20    echo "Timeout expired.";;
21  $DIALOG_ERROR)
22    echo "ERROR!";;
23  $DIALOG_ESC)
24    echo "ESC pressed.";;
25  *)
26    echo "Return code was $returncode";;
27esac
28