#!only-to-be-sourced # shellcheck shell=sh # shellcheck disable=SC2154 ############################################################################### # # 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() { usage_msg_path=/tmp/msg-$$ 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 full_msg="In ${args_stage}: $1" { echo; output_error_msg "${full_msg}"; echo; } >> "${usage_msg_path}" else touch "${usage_msg_path}" fi cat "${usage_msg_path}" - <