mirror of
				git://git.code.sf.net/p/zsh/code
				synced 2025-10-31 18:10:56 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			21 lines
		
	
	
	
		
			707 B
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
	
		
			707 B
		
	
	
	
		
			Text
		
	
	
	
	
	
| #autoload
 | |
| #
 | |
| # Function to decide whether a completions cache needs rebuilding
 | |
| 
 | |
| local _cache_ident _cache_dir _cache_path _cache_policy
 | |
| _cache_ident="$1"
 | |
| 
 | |
| # If the cache is disabled, we never want to rebuild it, so pretend
 | |
| # it's valid.
 | |
| zstyle -t ":completion:${curcontext}:" use-cache || return 1
 | |
| 
 | |
| zstyle -s ":completion:${curcontext}:" cache-path _cache_dir
 | |
| : ${_cache_dir:=${ZDOTDIR:-$HOME}/.zcompcache}
 | |
| _cache_path="$_cache_dir/$_cache_ident"
 | |
| 
 | |
| # See whether the caching policy says that the cache needs rebuilding
 | |
| # (the policy will return 0 if it does).
 | |
| zstyle -s ":completion:${curcontext}:" cache-policy _cache_policy
 | |
| [[ -n "$_cache_policy" ]] && "$_cache_policy" "$_cache_path" && return 0
 | |
| 
 | |
| return 1
 |