From f829f61b5dfd69d78748577b39aa9e1f54e2feac Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Sat, 25 Nov 2017 08:02:34 +0100 Subject: [PATCH] add: function ReadArguments --- albentohandy | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) 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 -- 2.47.3