############################################################################### # # medley_useage.sh - script defining the "usage" for medley.sh script. # # !!!! This script is meant to be SOURCEd from the scripts/medley.sh script. # !!!! It should not be run as a standlone script. # # 2023-01-21 Frank Halasz # # Copyright 2023 Interlisp.org # ############################################################################### PAGER=$( if [ -n $(which more) ]; then echo "more"; else echo "cat"; fi) usage() { local err_msg local msg_path=/tmp/msg-$$ local lines=("$@") if [ $# -ne 0 ]; then echo > ${msg_path} echo "$(output_error_msg "${lines[@]}")" >> ${msg_path} echo >> ${msg_path} echo >> ${msg_path} else touch ${msg_path} fi cat ${msg_path} - <