Commit 62abaceb authored by David Remy's avatar David Remy Committed by Marc Cornellà
Browse files

lib: fix issues with nounset and parameters used before defined (#7433)

parent 680755bb
...@@ -12,12 +12,12 @@ function omz_history { ...@@ -12,12 +12,12 @@ function omz_history {
builtin fc "$@" builtin fc "$@"
else else
# unless a number is provided, show all history events (starting from 1) # 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 fi
} }
# Timestamp format # Timestamp format
case $HIST_STAMPS in case ${HIST_STAMPS-} in
"mm/dd/yyyy") alias history='omz_history -f' ;; "mm/dd/yyyy") alias history='omz_history -f' ;;
"dd.mm.yyyy") alias history='omz_history -E' ;; "dd.mm.yyyy") alias history='omz_history -E' ;;
"yyyy-mm-dd") alias history='omz_history -i' ;; "yyyy-mm-dd") alias history='omz_history -i' ;;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment