Parameter handling

This commit is contained in:
Jeroen De Meerleer 2020-02-12 13:53:58 +01:00
parent 1d5c6b45ff
commit ad72437402

View File

@ -141,9 +141,8 @@ GetOptions() {
verbose=2 verbose=2
if [[ $2 != "" ]]; then if [[ $2 != "" ]]; then
verbose=${2} verbose=${2}
shift
fi fi
shift shift 2
;; ;;
-h|--help) -h|--help)
help=true help=true
@ -173,10 +172,9 @@ GetOptions() {
bitrate=192 bitrate=192
if [[ $2 != "" ]]; then if [[ $2 != "" ]]; then
bitrate=${2} bitrate=${2}
shift
fi fi
VerboseOutput 1 "Converted bitrate is ${bitrate}" VerboseOutput 1 "Converted bitrate is ${bitrate}"
shift shift 2
;; ;;
-a|--resize-art) -a|--resize-art)
VerboseOutput 0 "--resize-art given" VerboseOutput 0 "--resize-art given"
@ -184,9 +182,8 @@ GetOptions() {
coverartsize=200 coverartsize=200
if [[ $2 != "" ]]; then if [[ $2 != "" ]]; then
coverartsize=${2} coverartsize=${2}
shift
fi fi
shift shift 2
VerboseOutput 1 "Album art will ${coverartsize}px wide" VerboseOutput 1 "Album art will ${coverartsize}px wide"
;; ;;
-j|--jobs) -j|--jobs)
@ -195,9 +192,8 @@ GetOptions() {
jobcount="-2" jobcount="-2"
if [[ $2 != "" ]]; then if [[ $2 != "" ]]; then
jobcount=${2} jobcount=${2}
shift
fi fi
shift shift 2
VerboseOutput 1 "multithreading will use ${jobcount} threads" VerboseOutput 1 "multithreading will use ${jobcount} threads"
;; ;;
--) --)