]> gitweb.hhaalo.de Git - albentohandy.git/commitdiff
add: function ReadArguments
authorBastian Dehn <hhaalo@arcor.de>
Sat, 25 Nov 2017 07:02:34 +0000 (08:02 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sat, 25 Nov 2017 07:02:34 +0000 (08:02 +0100)
albentohandy

index 17efd2e15141663d1d4b0b8baaa667406404c7a4..9adc402aa6fdc58ade6f0983bef5073901e38fb5 100755 (executable)
@@ -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