summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2012-06-12 10:30:42 +0200
committerFlorian Bruhin <me@the-compiler.org>2012-06-12 10:30:42 +0200
commit8d5131c9ddbd38d65a92475096f2b848c120ff6a (patch)
treee49a99454a1019b17e83cb0b224a569c0cb8067a
parentc9e308f267366f69033d085b97aeab7aafbc564f (diff)
downloadquvi-dwb-8d5131c9ddbd38d65a92475096f2b848c120ff6a.tar.gz
quvi-dwb-8d5131c9ddbd38d65a92475096f2b848c120ff6a.zip
If the format_array is empty, take default format
-rwxr-xr-xquvi.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/quvi.sh b/quvi.sh
index 7444ca0..62b4629 100755
--- a/quvi.sh
+++ b/quvi.sh
@@ -11,7 +11,9 @@ fi
IFS='|' read -a format_array <<< "${formats%% : *}"
-if [[ ${#format_array[@]} == 1 ]]; then
+if [[ ${#format_array[@]} == 0 ]]; then
+ format="default"
+elif [[ ${#format_array[@]} == 1 ]]; then
format="${format_array[0]}"
else
format=$(zenity --text "Which format do you want?" --list --column=format default best "${format_array[@]}")