Reformat info.sh

This commit is contained in:
Ethan P 2020-04-08 14:16:46 -07:00 committed by David Peter
parent dd336e6fb2
commit 116d76a00f
1 changed files with 20 additions and 22 deletions

View File

@ -7,7 +7,6 @@ set -o pipefail
export LC_ALL=C
export LANG=C
# -----------------------------------------------------------------------------
# Modules:
# -----------------------------------------------------------------------------
@ -59,7 +58,7 @@ _bat_:run() {
_bat_config_:run() {
if [[ -f "$(bat --config-file)" ]]; then
_out_fence cat "$(bat --config-file)";
_out_fence cat "$(bat --config-file)"
fi
}
@ -77,17 +76,20 @@ _bat_wrapper_function_:run() {
if "$SHELL" --login -i -c 'type bat' 2>&1 | grep 'function' &> /dev/null; then
_out_fence "$SHELL" --login -c 'functions bat'
return
fi ;;
fi
;;
*bash* | *zsh*)
if "$SHELL" --login -i -c 'type bat' 2>&1 | grep 'function' &> /dev/null; then
_out_fence "$SHELL" --login -c 'declare -f bat'
return
fi ;;
fi
;;
*)
echo "Unable to determine if a wrapper function is set."
return ;;
return
;;
esac
printf "\nNo wrapper function.\n"
}
@ -103,7 +105,6 @@ _tool_:run() {
_out less --version | head -n1
}
# -----------------------------------------------------------------------------
# Functions:
# -----------------------------------------------------------------------------
@ -173,7 +174,7 @@ EOF
case "$response" in
Y | y | yes | '') return 0 ;;
N | n | no) return 1 ;;
*) continue
*) continue ;;
esac
done
}
@ -184,13 +185,12 @@ _run_module() {
"_$1_:run"
}
# -----------------------------------------------------------------------------
# Functions:
# -----------------------------------------------------------------------------
# Ask for consent.
if [[ "$1" = '-y' ]]; then
if [[ "$1" == '-y' ]]; then
_modules_consented=("${_modules[@]}")
else
trap '_tput rmcup; exit 1' INT
@ -208,5 +208,3 @@ for _module in "${_modules_consented[@]}"; do
_run_module "$_module" 2>&1
printf "\n"
done