mirror of
https://github.com/ksyasuda/aniwrapper.git
synced 2024-11-22 03:19:53 -08: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")
|
||||
QUALITY=$(awk '{print $2}' <<< "$selection")
|
||||
else
|
||||
printf "%s" "Enter quality [$QUALITIES]: "
|
||||
qualities="best|1080p|720p|480p|360p|worst"
|
||||
printf "%s" "Choose quality: [$qualities]: "
|
||||
read -r QUALITY
|
||||
while [[ ! "$QUALITY" =~ ($qualities) ]]; do
|
||||
lg "$QUALITY not a valid quality -> [$qualities]"
|
||||
printf "%s" "Choose quality: [$qualities]: "
|
||||
read -r QUALITY
|
||||
done
|
||||
fi
|
||||
lg "selected quality: $QUALITY"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user