diff --git a/sqn-completion.bash b/sqn-completion.bash index a8488f6..fd28964 100755 --- a/sqn-completion.bash +++ b/sqn-completion.bash @@ -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[@]}" }