Switch to PokeAPI #1
17
pokedex-dev
17
pokedex-dev
|
@ -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,22 +62,29 @@ 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"
|
fi
|
||||||
else
|
|
||||||
while (( $# )); do
|
while (( $# )); do
|
||||||
arg=$1
|
arg=$1
|
||||||
shift
|
shift
|
||||||
case "$arg" in
|
case "$arg" in
|
||||||
-q|--quick)
|
-q|--quick)
|
||||||
quick_view "$1"
|
quick_view "$1"
|
||||||
|
shift
|
||||||
;;
|
;;
|
||||||
-u|--update)
|
-u|--update)
|
||||||
update_pokeData "$1"
|
update_pokeData "$1"
|
||||||
|
shift
|
||||||
;;
|
;;
|
||||||
-h|--help)
|
-h|--help)
|
||||||
help
|
help
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
!(^-) )
|
||||||
|
pokedex "$arg"
|
||||||
|
shift
|
||||||
;;
|
;;
|
||||||
-* )
|
-* )
|
||||||
echo "Invalid Usage"
|
echo "Invalid Usage"
|
||||||
|
@ -84,4 +92,3 @@ else
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
fi
|
|
||||||
|
|
Loading…
Reference in New Issue