I'm writting some zsh functions using the powerful completion feature. The computation of my completions take some times and I want to make use of the completion caching policy. From the zsh manual (https://zsh.sourceforge.io/Doc/Release/Completion-System.html) I found this code snippet
example_caching_policy () {
# rebuild if cache is more than a week old
local -a oldp
oldp=( "$1"(Nm+7) )
(( $#oldp ))
}
I couldn't find any explanation on the (Nm+7)
syntax, what does Nm
means ? With try and error I could find out that for example Nms+1
would change the cache policy to 1 second, while Nmh+1
to 1 hour. But where can I find the general (NmX+N)
construct explanation ?
Same what does exactly means the line (( $#oldp ))
?