From fcd84a98d16af70fcd249c27f99ae8690adab443 Mon Sep 17 00:00:00 2001 From: Gyanendra Mishra Date: Mon, 13 Feb 2023 13:01:42 +0000 Subject: [PATCH] added a comment --- bash_completionsV2.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bash_completionsV2.go b/bash_completionsV2.go index 555ecfb8..5a38e38d 100644 --- a/bash_completionsV2.go +++ b/bash_completionsV2.go @@ -118,8 +118,13 @@ __%[1]s_process_completion_results() { fi if (((directive & shellCompDirectiveKeepOrder) != 0)); then if [[ $(type -t compopt) == builtin ]]; then - __%[1]s_debug "Activating keep order" - compopt -o nosort + # no sort isn't supported for bash less than < 4.4 + if [[ ${BASH_VERSINFO[0]} -lt 4 || ( ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 4 ) ]]; then + __%[1]s_debug "No sort directive not supported in this version of bash" + else + __%[1]s_debug "Activating keep order" + compopt -o nosort + fi else __%[1]s_debug "No sort directive not supported in this version of bash" fi