Added "daisy arg", a hooking tool that allows you to re-use arguments from previous commands.

This commit is contained in:
Lea 2026-06-09 13:17:56 +02:00
parent 0859ba819b
commit 60cc207011
3 changed files with 70 additions and 24 deletions

View file

@ -419,6 +419,18 @@ daisy ()
return 1
fi
;;
arg)
local index=$2
if [[ "$index" == "@" ]]; then
echo "${DAISY_LAST_ARGS[@]:1}"
elif [[ "$index" =~ ^[0-9]+$ ]]; then
if [[ -n "$ZSH_VERSION" ]]; then echo "${DAISY_LAST_ARGS[$((index+1))]}"; else echo "${DAISY_LAST_ARGS[$index]}"; fi
else
echo "Usage: daisy arg <index|@>"
return 1
fi
;;
reload)
LD_INTERNAL=0 source "$LD_SOURCE_FILE"
;;