############################################################################### # # 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 [ ${wsl} = true ]; then wsl_incl="+w" wsl_excl="-w" else wsl_incl="-w" wsl_excl="+w" fi if [ ${docker} = true ]; then docker_incl="+d" docker_excl="-d" else docker_incl="-d" docker_excl="+d" fi if [ ${windows} = true ]; then windows_incl="+W" windows_excl="-W" else windows_incl="-W" windows_excl="+W" fi 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} - <