mirror of
				https://github.com/ohmyzsh/ohmyzsh.git
				synced 2025-11-04 13:21:19 +08:00 
			
		
		
		
	
							parent
							
								
									1ed8d4b555
								
							
						
					
					
						commit
						eafa78217d
					
				@ -4,14 +4,14 @@ function omz_history {
 | 
			
		||||
  local clear list stamp
 | 
			
		||||
  zparseopts -E -D c=clear l=list f=stamp E=stamp i=stamp
 | 
			
		||||
 | 
			
		||||
  if [[ $# -eq 0 ]]; then
 | 
			
		||||
    # if no arguments provided, show full history starting from 1
 | 
			
		||||
    builtin fc $stamp -l 1
 | 
			
		||||
  elif [[ -n "$clear" ]]; then
 | 
			
		||||
  if [[ -n "$clear" ]]; then
 | 
			
		||||
    # if -c provided, clobber the history file
 | 
			
		||||
    echo -n >| "$HISTFILE"
 | 
			
		||||
    fc -p "$HISTFILE"
 | 
			
		||||
    echo >&2 History file deleted.
 | 
			
		||||
  elif [[ $# -eq 0 ]]; then
 | 
			
		||||
    # if no arguments provided, show full history starting from 1
 | 
			
		||||
    builtin fc $stamp -l 1
 | 
			
		||||
  else
 | 
			
		||||
    # otherwise, run `fc -l` with a custom format
 | 
			
		||||
    builtin fc $stamp -l "$@"
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user