summaryrefslogtreecommitdiff
path: root/bin/extra/p.sh
diff options
context:
space:
mode:
authorRaymaekers Luca <luca@spacehb.net>2025-01-09 16:52:07 +0100
committerRaymaekers Luca <luca@spacehb.net>2025-01-09 16:52:07 +0100
commitc8283a1ef06b15ab0b5871655f4bfaefe9518673 (patch)
treeee892a974ed799f708078def24e02f42cb70b5fa /bin/extra/p.sh
parentcc216ca760a6b22c8b8041f525859f4201a52d1f (diff)
parent11137f566712166f593eee3466a0287b8f3fad7b (diff)
Merge branch 'main' of db:dotfiles
Diffstat (limited to 'bin/extra/p.sh')
-rwxr-xr-xbin/extra/p.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/bin/extra/p.sh b/bin/extra/p.sh
index ff36e71..681b9ab 100755
--- a/bin/extra/p.sh
+++ b/bin/extra/p.sh
@@ -661,14 +661,17 @@ html="/tmp/pk_tmp.html"
[ "$pokemon" ] || pokemon="$(ask_pokemon)"
[ "$pokemon" ] || exit 1
-case "$1" in
+choice="$(printf 'evolution\nmoves\nstats\n' | commander -c -w 3)"
+[ "$choice" ] || exit 1
+
+case "$choice" in
# evolution
e*)
url="https://pokemondb.net/pokedex/$pokemon"
curl -Ls "$url" > "$html"
level1="$(pup -p 'span.infocard:nth-child(2) > small:nth-child(2) text{}' < "$html")"
level2="$(pup -p 'span.infocard:nth-child(4) > small:nth-child(2) text{}' < "$html")"
- herbe "_p.sh" "$level1\n$level2"
+ herbe "_p.sh" "$level1" "$level2"
;;
# moves
@@ -676,7 +679,4 @@ case "$1" in
# stats
s*) $BROWSER "https://www.smogon.com/dex/bw/pokemon/$pokemon/" ;;
- *)
- choice="$(printf 'evolution\nmoves\nstats\n' | commander -c -w 3)"
- [ "$choice" ] && pokemon="$pokemon" $0 "$choice" ;;
esac