From 233ac2844998eee3e69dfe8879bfc07d6eacb558 Mon Sep 17 00:00:00 2001 From: Eric Lay Date: Tue, 18 Apr 2023 09:25:16 -0500 Subject: [PATCH] Added quick view --- pokedex | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pokedex b/pokedex index c24a9bc..6897250 100755 --- a/pokedex +++ b/pokedex @@ -6,7 +6,7 @@ help() { echo -e "Can optionally search by name" echo -e "EXAMPLE\n\tpokedex [pokemon name]\n" echo -e "OPTIONS" - echo -e "\t-u, --update [N/+N/-N/N%]\n\t\tScrape web for updated Pokemon stats\n\t\tWARNING: update function is resource heavy\n\t\tSee Parallel job control (-j) for options\n\t\tDefault is 200%\n\t-h, --help\n\t\tPrint this help screen" + echo -e "\t-q, --quick [pokemon]\n\t\tPrints single pokedex entry to terminal\n\t-u, --update [N/+N/-N/N%]\n\t\tScrape web for updated Pokemon stats\n\t\tWARNING: update function is resource heavy\n\t\tSee Parallel job control (-j) for options\n\t\tDefault is 200%\n\t-h, --help\n\t\tPrint this help screen" echo -e "KEYBINDS" echo -e "\tctrl-n\tShows small sprite version\n\tctrl-b\tShows large sprite version\n\tctrl-s\tShows shiny sprite version\n\tctrl-h\tShows this help screen in preview window\n" } @@ -40,6 +40,12 @@ pokedex() { parallel pokemon-colorscripts --no-title -n {} "&&" cat "$POKEDATA"{} } + +### Quick view returns single Pokemon stat instead of opening pokedex +quick_view() { + echo "$1" | parallel pokemon-colorscripts --no-title -n {} "&&" cat "$POKEDATA{}" +} + ### Update Pokemon stats file set update_pokeData() { echo -e "\n\t\tWARNING!!!\n\tThis WILL take a long time\n" @@ -55,6 +61,9 @@ if [[ ! "$1" =~ ^- ]]; then else for opt in "$@"; do case $opt in + -q|--quick) + quick_view "$2" + ;; -u|--update) update_pokeData "$2" ;;