diff --git a/README.MD b/README.MD index e91d272..cb0869a 100644 --- a/README.MD +++ b/README.MD @@ -13,11 +13,10 @@ Syncronises music from one folder to another. Options: -s, --source The source folder of the music - -d, --dest The destionation folder of the music + -d, --dest The destination folder of the music -t, --temp The temporary cache for converted files (default: /tmp/converted) - -c, --convert Convert files before syncing - -a, --convert-art Convert album-art before syncing (default width: 200) - -b, --bitrate When converting use this bitrate + -c, --convert Convert files to a given bitrate in kbps before syncing (default: 192) + -a, --resize-art Resize album-art before syncing (default width: 200) -v, --verbose <0-6> Set log level (default: 2) -h, --help Display this help text diff --git a/music-sync.sh b/music-sync.sh index ca25d17..0b71f64 100755 --- a/music-sync.sh +++ b/music-sync.sh @@ -60,8 +60,8 @@ CheckDeps() { GetOptions() { # https://stackoverflow.com/a/29754866 - OPTIONS=s:d:t:ca::b:v::h - LONGOPTS=source:,dest:,temp:,convert,convert-art::,bitrate:,verbose::,help + OPTIONS=s:d:t:c::a::v::h + LONGOPTS=source:,dest:,temp:,convert::,resize-art::,verbose::,help # -use ! and PIPESTATUS to get exit code with errexit set # -temporarily store output to be able to check for errors @@ -107,9 +107,14 @@ GetOptions() { ;; -c|--convert) convert=true + bitrate=192 + if [[ $2 != "" ]]; then + bitrate=${2} + shift + fi shift ;; - -a|--convert-art) + -a|--resize-art) convertart=true coverartsize=200 if [[ $2 != "" ]]; then @@ -118,10 +123,6 @@ GetOptions() { fi shift ;; - -b|--bitrate) - bitrate="$2" - shift 2 - ;; --) shift break @@ -156,11 +157,10 @@ Usage() { echo "" echo "Options:" echo " -s, --source The source folder of the music" - echo " -d, --dest The destionation folder of the music" + echo " -d, --dest The destination folder of the music" echo " -t, --temp The temporary cache for converted files (default: /tmp/converted)" - echo " -c, --convert Convert files before syncing" - echo " -a, --convert-art Convert album-art before syncing (default width: 200)" - echo " -b, --bitrate When converting use this bitrate" + echo " -c, --convert Convert files to a given bitrate in kbps before syncing (default: 192)" + echo " -a, --resize-art Resize album-art before syncing (default width: 200)" echo " -v, --verbose <0-6> Set log level (default: 2)" echo " -h, --help Display this help text" echo ""