diff --git a/.github/README.md b/.github/README.md index 48f4221..fdf78ec 100644 --- a/.github/README.md +++ b/.github/README.md @@ -221,6 +221,7 @@ Please note any command with an argument in angle brackets below (ie. `` 1. `genhex `: generate and copy pseudo-random hex string of specified length (of default length 32) 2. `genb64 `: generate and copy pseudo-random base64 string of specified length (of default length 32) 3. `copy `: copy a string or the output of a shell command (using $() syntax) to your clipboard +4. `lastcmd`: copy the last command you ran to your clipboard ### Miscellaneous Utilities diff --git a/wix-cli.sh b/wix-cli.sh index ce0598d..3bad602 100755 --- a/wix-cli.sh +++ b/wix-cli.sh @@ -477,6 +477,7 @@ if [ $num_args -eq 0 ]; then echo "- genhex ${ORANGE}: generate and copy pseudo-random hex string (of default length 32)${RESET}" echo "- genb64 ${ORANGE}: generate and copy pseudo-random base64 string (of default length 32)${RESET}" echo "- copy ${ORANGE}: copy a string or the output of a shell command (using \$() syntax) to your clipboard${RESET}" + echo "- lastcmd ${ORANGE}: copy the last command you ran to your clipboard${RESET}" echo "" h1_text "MISC UTILITIES:" echo "- weather ${ORANGE}: get the weather forecast for your current location${RESET}" @@ -833,6 +834,13 @@ elif [ "$1" = "copy" ]; then clipboard "$text" fi +# LAST COMMAND + +elif [ "$1" = "lastcmd" ]; then + lastcmd=$(fc -ln -1) + trimmed=$(echo "$lastcmd" | xargs) + clipboard "$trimmed" + # IP ADDRESS elif [ "$1" = "ip" ]; then