Switch to PokeAPI #1

Merged
ericlay merged 20 commits from dev into main 2023-04-24 19:05:08 -05:00
1 changed files with 30 additions and 23 deletions
Showing only changes of commit 8379ac706a - Show all commits

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
### Overhad preparation ### Overhad preparation
shopt -s extglob
KBINDS="/usr/share/fuzzy-pokedex-dev/keybindings-preview" KBINDS="/usr/share/fuzzy-pokedex-dev/keybindings-preview"
POKEDATA="/usr/share/fuzzy-pokedex-dev/pokeData" POKEDATA="/usr/share/fuzzy-pokedex-dev/pokeData"
@ -61,27 +62,33 @@ update_pokeData() {
pokemon-colorscripts -l | sort | parallel --progress --bar --color --retry-failed -j "${1:-200%}" pokeInfo {} ">" "$POKEDATA/{}" 2>&1 pokemon-colorscripts -l | sort | parallel --progress --bar --color --retry-failed -j "${1:-200%}" pokeInfo {} ">" "$POKEDATA/{}" 2>&1
} }
### Arg parsing loop if ! (( $# )); then
if [[ ! "$1" =~ ^- ]]; then pokedex
pokedex "$1"
else
while (( $# )); do
arg=$1
shift
case "$arg" in
-q|--quick)
quick_view "$1"
;;
-u|--update)
update_pokeData "$1"
;;
-h|--help)
help
;;
-*)
echo "Invalid Usage"
help
;;
esac
done
fi fi
while (( $# )); do
arg=$1
shift
case "$arg" in
-q|--quick)
quick_view "$1"
shift
;;
-u|--update)
update_pokeData "$1"
shift
;;
-h|--help)
help
shift
;;
!(^-) )
pokedex "$arg"
shift
;;
-* )
echo "Invalid Usage"
help
;;
esac
done