From cd09b8162673c44dc0984dc18da3c98beda550cc Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sat, 18 May 2013 11:24:49 +0200 Subject: 33137: _path_files: complete # to introduce a glob flag --- Completion/Unix/Type/_path_files | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'Completion') diff --git a/Completion/Unix/Type/_path_files b/Completion/Unix/Type/_path_files index 85feae54c..ed3f54de3 100644 --- a/Completion/Unix/Type/_path_files +++ b/Completion/Unix/Type/_path_files @@ -15,13 +15,21 @@ local -a match mbegin mend # a bare glob qualifier. # The later test looks for an outstanding quote. if _have_glob_qual $PREFIX; then - compset -p ${#match[1]} - if [[ $_comp_caller_options[extendedglob] == on ]] && compset -P '\#'; then - _globflags - else - _globquals - fi - return + local ret=1 + compset -p ${#match[1]} + if [[ $_comp_caller_options[extendedglob] == on ]] && compset -P '\#'; then + _globflags && ret=0 + else + if [[ $_comp_caller_options[extendedglob] == on ]]; then + local -a flags + flags=( + '#:introduce glob flag' + ) + _describe -t globflags "glob flag" flags -Q -S '' && ret=0 + fi + _globquals && ret=0 + fi + return ret fi # Utility function for in-path completion. This allows `/u/l/b' -- cgit 1.4.1