Ability to show sqn_ alias in sequencer help
outColor accepts a custom color number (0-255)
This commit is contained in:
@@ -5,14 +5,27 @@ _sqnall_completions()
|
||||
# Current search string
|
||||
local cur=${COMP_WORDS[COMP_CWORD]}
|
||||
# Extract alias command with buildins same as:
|
||||
# local curCmd="$(alias $1 | sed "s/^alias.*='\(.*\)'$/\1/")"
|
||||
# local curCmd="$(alias $1 | sed "s/^alias.*\" \(.*\)'$/\1/")"
|
||||
local curCmd="$(alias "$1")"
|
||||
curCmd="${curCmd#*=\'}"
|
||||
curCmd="${curCmd##*\" }"
|
||||
curCmd="${curCmd%\'*}"
|
||||
COMPREPLY=()
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W '-c -d -h -ha -ls -p -pl -q -qq -s -v --version' -- $cur ) );;
|
||||
COMPREPLY=( $( compgen -W '\
|
||||
-a --all \
|
||||
-c --config \
|
||||
-d --dry-run \
|
||||
-h --help \
|
||||
-ha --helpapi \
|
||||
-ls --liststeps \
|
||||
-p --profile \
|
||||
-pl \
|
||||
-q --quiet \
|
||||
-qq \
|
||||
-s --single \
|
||||
-v --verbose \
|
||||
--version' -- $cur ) );;
|
||||
*)
|
||||
# Stop after step selection (last argument which is not an option; starting with "-")
|
||||
(( COMP_CWORD > 1 )) && [[ ! "${COMP_WORDS[((COMP_CWORD - 1))]}" =~ ^- ]] && return
|
||||
@@ -32,7 +45,7 @@ installCompletion() {
|
||||
SEQLIST[$i]="${SEQLIST[$i]##*/}"
|
||||
SEQLIST[$i]="${SEQLIST[$i]%.*}"
|
||||
SEQSHORT[$i]="${SEQPREFIX}${SEQLIST[$i]}"
|
||||
alias ${SEQSHORT[$i]}="$SEQBASE/${SEQLIST[$i]}.sh"
|
||||
alias ${SEQSHORT[$i]}="_SQN_ALIAS=\"${SEQSHORT[$i]}\" $SEQBASE/${SEQLIST[$i]}.sh"
|
||||
done
|
||||
complete -o nosort -o bashdefault -o default -F _sqnall_completions ${SEQSHORT[@]}
|
||||
}
|
||||
|
Reference in New Issue
Block a user