Added "daisy arg", a hooking tool that allows you to re-use arguments from previous commands.
This commit is contained in:
parent
0859ba819b
commit
60cc207011
3 changed files with 70 additions and 24 deletions
|
|
@ -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"
|
||||
;;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue