From: Bastian Dehn Date: Sat, 25 Nov 2017 07:02:34 +0000 (+0100) Subject: add: function ReadArguments X-Git-Tag: v1.0.0^2~92 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=f829f61b5dfd69d78748577b39aa9e1f54e2feac;p=albentohandy.git add: function ReadArguments --- diff --git a/albentohandy b/albentohandy index 17efd2e..9adc402 100755 --- a/albentohandy +++ b/albentohandy @@ -182,19 +182,7 @@ SetDefaultVariables() { cptodest=false } -main() { - WORK="$(pwd)/work.$$" # temporary working directory - SCRIPTPATH="/usr/bin" # path to flactomp3v2 and notify.sh script - MUSICPATH="/tmp/musikpath" # flac collection directory - - ExistsBasicProgramms - LoadConfig - - ExistsScripts "$SCRIPTPATH" - - SetDefaultVariables - - # read parameters +ReadArguments() { while getopts "chi:m:S:rw:z:" optname; do case "$optname" in "c") @@ -229,6 +217,21 @@ main() { ;; esac done +} + +main() { + WORK="$(pwd)/work.$$" # temporary working directory + SCRIPTPATH="/usr/bin" # path to flactomp3v2 and notify.sh script + MUSICPATH="/tmp/musikpath" # flac collection directory + + ExistsBasicProgramms + LoadConfig + + ExistsScripts "$SCRIPTPATH" + + SetDefaultVariables + + ReadArguments $* # check albumlist is set if [ ! -f "$albumlist" ]; then