WIP sqn alias in lower case, end output if no profiles or steps are found
This commit is contained in:
@@ -41,6 +41,7 @@ _sqn_completions()
|
|||||||
# Support for profile names with spaces
|
# Support for profile names with spaces
|
||||||
COMPREPLY+=("$(printf '%q' "${comp}")")
|
COMPREPLY+=("$(printf '%q' "${comp}")")
|
||||||
done
|
done
|
||||||
|
[[ ${#COMPREPLY[@]} == 0 ]] && COMPREPLY=( "-- No profiles found --" " " )
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
# Stop after step selection (last argument which is not an option (starting with "-|+")
|
# Stop after step selection (last argument which is not an option (starting with "-|+")
|
||||||
@@ -61,6 +62,7 @@ _sqn_completions()
|
|||||||
# Support for aliases with spaces
|
# Support for aliases with spaces
|
||||||
COMPREPLY+=("$(printf '%q' "${comp}")")
|
COMPREPLY+=("$(printf '%q' "${comp}")")
|
||||||
done
|
done
|
||||||
|
[[ ${#COMPREPLY[@]} == 0 ]] && COMPREPLY=( "-- No steps found --" " " )
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
@@ -92,7 +94,7 @@ installCompletion() {
|
|||||||
seq_short[$i]="${seq_prefix}${seq_list[$i]/[[:blank:]]/_}"
|
seq_short[$i]="${seq_prefix}${seq_list[$i]/[[:blank:]]/_}"
|
||||||
# shellcheck disable=SC2139,SC2086
|
# shellcheck disable=SC2139,SC2086
|
||||||
# alias should be expanded when defined
|
# alias should be expanded when defined
|
||||||
alias ${seq_short[$i]}="_SQN_ALIAS=\"${seq_short[$i]}\" \"${seq_base}/${seq_list[$i]}.sh\""
|
alias ${seq_short[$i]}="_sqn_alias=\"${seq_short[$i]}\" \"${seq_base}/${seq_list[$i]}.sh\""
|
||||||
done
|
done
|
||||||
complete -o nosort -o bashdefault -o default -F _sqn_completions "${seq_short[@]}"
|
complete -o nosort -o bashdefault -o default -F _sqn_completions "${seq_short[@]}"
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user