mirror of
https://github.com/ksyasuda/aniwrapper.git
synced 2024-10-28 04:44:11 -07:00
better error handling for command-line quality selection
This commit is contained in:
parent
50af29a5bd
commit
dad456eac9
@ -103,8 +103,14 @@ get_quality() {
|
|||||||
-sep '|' -only-match <<< "$QUALITIES")
|
-sep '|' -only-match <<< "$QUALITIES")
|
||||||
QUALITY=$(awk '{print $2}' <<< "$selection")
|
QUALITY=$(awk '{print $2}' <<< "$selection")
|
||||||
else
|
else
|
||||||
printf "%s" "Enter quality [$QUALITIES]: "
|
qualities="best|1080p|720p|480p|360p|worst"
|
||||||
|
printf "%s" "Choose quality: [$qualities]: "
|
||||||
read -r QUALITY
|
read -r QUALITY
|
||||||
|
while [[ ! "$QUALITY" =~ ($qualities) ]]; do
|
||||||
|
lg "$QUALITY not a valid quality -> [$qualities]"
|
||||||
|
printf "%s" "Choose quality: [$qualities]: "
|
||||||
|
read -r QUALITY
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
lg "selected quality: $QUALITY"
|
lg "selected quality: $QUALITY"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user