mirror of
				https://github.com/dcarrillo/prezto.git
				synced 2025-11-04 10:59:08 +00:00 
			
		
		
		
	[Fix #249] Add documentation for helper
This commit is contained in:
		@@ -1,14 +1,18 @@
 | 
				
			|||||||
Trap
 | 
					Helper
 | 
				
			||||||
====
 | 
					======
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Provides for trapping UNIX signals and calling callback functions when a trap
 | 
					Provides helper functions for developing modules.
 | 
				
			||||||
is triggered.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
Functions
 | 
					Functions
 | 
				
			||||||
---------
 | 
					---------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  - `add-zsh-trap` adds a function name to a list to be called when a trap is
 | 
					  - `add-zsh-trap` adds a function name to a list to be called when a trap is
 | 
				
			||||||
    triggered.
 | 
					    triggered.
 | 
				
			||||||
 | 
					  - `is-autoloadable` checks if a file can be autoloaded by trying to load it
 | 
				
			||||||
 | 
					    in a subshell.
 | 
				
			||||||
 | 
					  - `is-callable` checks if a name is a command, function, or alias.
 | 
				
			||||||
 | 
					  - `is-true` checks a boolean variable for "true".
 | 
				
			||||||
 | 
					  - `coalesce` prints the first non-empty string in the arguments array.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Authors
 | 
					Authors
 | 
				
			||||||
-------
 | 
					-------
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,7 +10,7 @@ function is-autoloadable {
 | 
				
			|||||||
  ( unfunction $1 ; autoload -U +X $1 ) &> /dev/null
 | 
					  ( unfunction $1 ; autoload -U +X $1 ) &> /dev/null
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Checks a name if it is a command, function, or alias.
 | 
					# Checks if a name is a command, function, or alias.
 | 
				
			||||||
function is-callable {
 | 
					function is-callable {
 | 
				
			||||||
  (( $+commands[$1] )) || (( $+functions[$1] )) || (( $+aliases[$1] ))
 | 
					  (( $+commands[$1] )) || (( $+functions[$1] )) || (( $+aliases[$1] ))
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user