From 44da7137096bfabf139f3407964f7fd78e0008aa Mon Sep 17 00:00:00 2001 From: Santiago Lo Coco Date: Sat, 29 Jan 2022 11:37:13 -0300 Subject: [PATCH] Shorten the line length (maximum: 160) --- install.sh | 17 +++++++++++++---- new.sh | 1 + 2 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 new.sh diff --git a/install.sh b/install.sh index 0a65d25..e7b1a09 100755 --- a/install.sh +++ b/install.sh @@ -515,9 +515,8 @@ checkForSystemdUnit() { printStepIfDebug() { if [ "$debugFlagToFile" = true ] || [ "$debugFlag" = true ]; then - printf '\n%s' "============================================================" >> calsais.log - printf '\n%s\n' "$step" >> calsais.log - printf '%s\n' "============================================================" >> calsais.log + printf '\n%s\n%s\n%s\n' "============================================================" "$step" \ + "============================================================" >> calsais.log fi } @@ -538,11 +537,21 @@ steps=( finishInstallation ) +usage() { + cat << EOF +usage: ${0##*/} [command] + -h Print this help message. + -d Print log to stdout and calsais.log file. + -f Print log to calsais.log file. + -s Print log to stdout. +EOF +} + runScript() { debugFlag=false; debugFlagToFile=false; debugFlagToStdout=false while getopts ':hdfs' flag; do case $flag in - h) printf 'usage: %s [command]\n\t-h\tPrint this help message.\n\t-s\tDebug to stdout and to calsais.log file.\n\t-f\tDebug to calsais.log file.\t-s\tDebug to stdout.\n\n' "${0##*/}" && exit 0 ;; + h) usage && exit 0 ;; d) debugFlag=true ;; f) debugFlagToFile=true ;; s) debugFlagToStdout=true ;; diff --git a/new.sh b/new.sh new file mode 100644 index 0000000..bb9d020 --- /dev/null +++ b/new.sh @@ -0,0 +1 @@ +printf 'usage: %s [command]\n\t-h\tPrint this help message.\n\t-s\tDebug to stdout and to calsais.log file.\n\t-f\tDebug to calsais.log file.\t-s\tDebug to stdout.\n\n' "${0##*/}"