From b0bf6bcfb3dbd9606c15df34d347b747220d6dc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Tue, 16 Apr 2024 19:34:54 +0200 Subject: [PATCH] fix(history): fix edge cases, add comments --- lib/history.zsh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/history.zsh b/lib/history.zsh index 2d3f28a3e..7123c1c93 100644 --- a/lib/history.zsh +++ b/lib/history.zsh @@ -1,5 +1,6 @@ ## History wrapper function omz_history { + # parse arguments and remove from $@ local clear list stamp zparseopts -E -D c=clear l=list f=stamp E=stamp i=stamp @@ -9,14 +10,14 @@ function omz_history { elif [[ -n "$clear" ]]; then # if -c provided, clobber the history file echo -n >| "$HISTFILE" - fc $stamp -p "$HISTFILE" + fc -p "$HISTFILE" echo >&2 History file deleted. elif [[ -n "$list" ]]; then # if -l provided, run as if calling `fc' directly - builtin fc $stamp "$@" + builtin fc $stamp -l "$@" else # otherwise, run `fc -l` with a custom format - builtin fc -l "$@" + builtin fc $stamp -l "$@" fi }