mirror of
				https://github.com/ohmyzsh/ohmyzsh.git
				synced 2025-11-04 13:21:19 +08:00 
			
		
		
		
	lib: fix issues with nounset and parameters used before defined (#7433)
This commit is contained in:
		
							parent
							
								
									680755bbe6
								
							
						
					
					
						commit
						62abacebea
					
				@ -12,12 +12,12 @@ function omz_history {
 | 
			
		||||
    builtin fc "$@"
 | 
			
		||||
  else
 | 
			
		||||
    # unless a number is provided, show all history events (starting from 1)
 | 
			
		||||
    [[ ${@[-1]} = *[0-9]* ]] && builtin fc -l "$@" || builtin fc -l "$@" 1
 | 
			
		||||
    [[ ${@[-1]-} = *[0-9]* ]] && builtin fc -l "$@" || builtin fc -l "$@" 1
 | 
			
		||||
  fi
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# Timestamp format
 | 
			
		||||
case $HIST_STAMPS in
 | 
			
		||||
case ${HIST_STAMPS-} in
 | 
			
		||||
  "mm/dd/yyyy") alias history='omz_history -f' ;;
 | 
			
		||||
  "dd.mm.yyyy") alias history='omz_history -E' ;;
 | 
			
		||||
  "yyyy-mm-dd") alias history='omz_history -i' ;;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user