Skip to content

Commit 0cd6cef

Browse files
committed
Add a command to get list all the handled completions
1 parent fa70a43 commit 0cd6cef

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ to update all the the available completions at every TAB-completion.
2929
This is disabled by default, to avoid IO operations at each completion, but it
3030
is still very fast in most of the platforms.
3131

32-
Once loaded you can see all the completions available via bash using
32+
Once loaded you can see all the completions available via bash (through this
33+
script) using:
3334

34-
for command completion in ${(kv)_comps}; do printf "%-32s %s\n" $command $completion; done | sort | grep _bash_completer
35+
_bash_completions_fallback_list_handled_completions
3536

3637

3738
Requirements

zsh-bash-completions-fallback.plugin.zsh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,3 +222,15 @@ if [ -n "$ZSH_BASH_COMPLETIONS_FALLBACK_LAZYLOAD_DISABLE" ]; then
222222
else
223223
_bash_completions_lazy_load
224224
fi
225+
226+
function _bash_completions_fallback_list_handled_completions()
227+
{
228+
local -a our_completions=();
229+
for command completion in ${(kv)_comps}; do
230+
if [ "$completion" = _bash_completions_fallback_completer ]; then
231+
our_completions+=($command)
232+
fi
233+
done
234+
235+
printf "%-32s\n" ${(o)our_completions[@]}
236+
}

0 commit comments

Comments
 (0)