1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-05-20 06:56:05 +02:00

43818: complete math functions for other modules besides zsh/mathfunc

This commit is contained in:
Oliver Kiddle 2018-11-12 10:34:32 +01:00
parent d5fec6b512
commit 082f703ccd
2 changed files with 11 additions and 5 deletions

View File

@ -1,5 +1,8 @@
2018-11-12 Oliver Kiddle <okiddle@yahoo.co.uk>
* 43818: Completion/Zsh/Type/_module_math_func: complete math
functions for other modules besides zsh/mathfunc
* 43816: Completion/Linux/Command/_valgrind,
Completion/BSD/Command/_vmctl, Completion/Linux/Command/_ethtool,
Completion/Linux/Command/_losetup, Completion/Linux/Command/_lsblk,

View File

@ -1,9 +1,12 @@
#autoload
local expl
local -a funcs
local mod
local -a funcs alts
local -a modules=( example mathfunc system )
funcs=(${${${(f)"$(zmodload -Fl zsh/mathfunc 2>/dev/null)"}:#^+f:*}##+f:})
for mod in $modules; do
funcs=( ${${${(f)"$(zmodload -Fl zsh/$mod 2>/dev/null)"}:#^+f:*}##+f:} )
alts+=( "module-math-functions.${mod}:math function from zsh/${mod}:compadd -S '(' $funcs" )
done
_wanted module-math-functions expl 'math function from zsh/mathfunc' \
compadd -S '(' -q "$@" -a funcs
_alternative $alts