fix(history): fix edge cases introduced in #12341 (#12357)
Diff
1diff --git a/lib/history.zsh b/lib/history.zsh
2index 56dda24627f747ee0e413c3a2e895a417045afe7..ec89bc15eb6d3bcddc17ac9a2bdcf6286744e401 100644
3--- a/lib/history.zsh
4+++ b/lib/history.zsh
5@@ -1,22 +1,20 @@
6 ## History wrapper
7 function omz_history {
8- local clear list
9- zparseopts -E c=clear l=list
10+ # parse arguments and remove from $@
11+ local clear list stamp
12+ zparseopts -E -D c=clear l=list f=stamp E=stamp i=stamp
1314 if [[ $# -eq 0 ]]; then
15 # if no arguments provided, show full history starting from 1
16- builtin fc -l 1
17+ builtin fc $stamp -l 1
18 elif [[ -n "$clear" ]]; then
19 # if -c provided, clobber the history file
20 echo -n >| "$HISTFILE"
21 fc -p "$HISTFILE"
22 echo >&2 History file deleted.
23- elif [[ -n "$list" ]]; then
24- # if -l provided, run as if calling `fc' directly
25- builtin fc "$@"
26 else
27 # otherwise, run `fc -l` with a custom format
28- builtin fc -l "$@"
29+ builtin fc $stamp -l "$@"
30 fi
31 }
32