WIP sqn alias in lower case, end output if no profiles or steps are found

This commit is contained in:
2022-05-29 18:38:13 +02:00
parent 7de1f7673f
commit f295343814

View File

@@ -41,6 +41,7 @@ _sqn_completions()
# Support for profile names with spaces
COMPREPLY+=("$(printf '%q' "${comp}")")
done
[[ ${#COMPREPLY[@]} == 0 ]] && COMPREPLY=( "-- No profiles found --" " " )
;;
*)
# Stop after step selection (last argument which is not an option (starting with "-|+")
@@ -61,6 +62,7 @@ _sqn_completions()
# Support for aliases with spaces
COMPREPLY+=("$(printf '%q' "${comp}")")
done
[[ ${#COMPREPLY[@]} == 0 ]] && COMPREPLY=( "-- No steps found --" " " )
;;
esac
;;
@@ -92,7 +94,7 @@ installCompletion() {
seq_short[$i]="${seq_prefix}${seq_list[$i]/[[:blank:]]/_}"
# shellcheck disable=SC2139,SC2086
# 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
complete -o nosort -o bashdefault -o default -F _sqn_completions "${seq_short[@]}"
}