Skip to content

Commit

Permalink
Merge pull request #26 from hwixley/lastcmd
Browse files Browse the repository at this point in the history
GPT-commit: Modify README.md and wix-cli.sh for upcoming release.
  • Loading branch information
hwixley authored Aug 4, 2023
2 parents 54d5402 + 9e29b26 commit 7f7e625
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ Please note any command with an argument in angle brackets below (ie. `<branch>`
1. `genhex <hex-length?>`: generate and copy pseudo-random hex string of specified length (of default length 32)
2. `genb64 <base64-length?>`: generate and copy pseudo-random base64 string of specified length (of default length 32)
3. `copy <string?|cmd?>`: copy a string or the output of a shell command (using $(<cmd>) syntax) to your clipboard
4. `lastcmd`: copy the last command you ran to your clipboard
### Miscellaneous Utilities
Expand Down
8 changes: 8 additions & 0 deletions wix-cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ if [ $num_args -eq 0 ]; then
echo "- genhex <hex-length?> ${ORANGE}: generate and copy pseudo-random hex string (of default length 32)${RESET}"
echo "- genb64 <base64-length?> ${ORANGE}: generate and copy pseudo-random base64 string (of default length 32)${RESET}"
echo "- copy <string?|cmd?> ${ORANGE}: copy a string or the output of a shell command (using \$(<cmd>) 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 <city?> ${ORANGE}: get the weather forecast for your current location${RESET}"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7f7e625

Please sign in to comment.