Ability to show sqn_ alias in sequencer help

outColor accepts a custom color number (0-255)
This commit is contained in:
2022-02-09 15:44:22 +01:00
parent a9491aa84a
commit 58a8ec6eae
2 changed files with 25 additions and 12 deletions

View File

@@ -9,7 +9,7 @@
VERSION_REV=14
VERSION_MAJOR=0
VERSION_MINOR=1
VERSION_MINOR=2
## Start of generic script part
@@ -60,8 +60,10 @@ SAVE_POS= ;[ -t 1 ] && SAVE_POS='\033[3D\033[s\033[3C'
RESTORE_POS= ;[ -t 1 ] && RESTORE_POS='\033[u'
helpSequencer() {
local scriptName=${0##*/}
[ ! -z "$_SQN_ALIAS" ] && scriptName="$_SQN_ALIAS"
cat <<USAGE_EOF
Usage: ${0##*/} [OPTIONS] [STEP NUMBER(s) or ALIAS] [STEP ARGUMENTS]
Usage: $scriptName [OPTIONS] [STEP NUMBER(s) or ALIAS] [STEP ARGUMENTS]
[OPTIONS]
--all, -a : Run all steps regardless of continuity
@@ -276,6 +278,7 @@ echoerr() { outColor red; >&2 echo "$@"; outColor none; }
# outColor <FOREGROUND COLOR> [BACKGROUND COLOR]
outColor() {
[ ! -t 1 ] && return 0
[ -z "$1" ] && tput sgr0 && return 0
case "$1" in
black)
tput setaf 0;;
@@ -294,8 +297,7 @@ outColor() {
white)
tput setaf 7;;
*)
tput sgr0
return;;
tput setaf $1;;
esac
case "$2" in
@@ -510,8 +512,7 @@ initSeqConfig() {
# Create config subdir in users home
if [ ! -e "$configDir/" ] ; then
echoseq -n " [I] Creating $(realpath $configDir)..."
exe mkdir -p "$configDir" && echoseq "Ok" || echoseq "Nok"
exe chmod 700 "$configDir"
exe install -m 700 -d "$configDir" && echoseq "Ok" || echoseq "Nok"
fi
SEQ_CONFIG_HOME="$configDir"
@@ -538,9 +539,8 @@ initSeqConfig() {
return 0
fi
exe cp -ar "$configTemplate" "$configLoc"
exe install -m 600 -T "$configTemplate" "$configLoc"
endReturn -o $? "Failed to create configuration"
exe chmod 600 "$configLoc"
if [ $sourceAlways -eq 0 ] ; then
if [ $SEQ_CONFIG_EDIT -eq 0 ] ; then