Changed naming of options to and simplified parameters

This commit is contained in:
Jeroen De Meerleer 2019-03-16 17:51:57 +01:00
parent 25aa38222b
commit f44bfd0ef9
2 changed files with 14 additions and 15 deletions

View File

@ -13,11 +13,10 @@ Syncronises music from one folder to another.
Options:
-s, --source <source> The source folder of the music
-d, --dest <destination> The destionation folder of the music
-d, --dest <destination> The destination folder of the music
-t, --temp <folder> The temporary cache for converted files (default: /tmp/converted)
-c, --convert Convert files before syncing
-a, --convert-art <width> Convert album-art before syncing (default width: 200)
-b, --bitrate When converting use this bitrate
-c, --convert <bitrate> Convert files to a given bitrate in kbps before syncing (default: 192)
-a, --resize-art <width> Resize album-art before syncing (default width: 200)
-v, --verbose <0-6> Set log level (default: 2)
-h, --help Display this help text

View File

@ -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 <source> The source folder of the music"
echo " -d, --dest <destination> The destionation folder of the music"
echo " -d, --dest <destination> The destination folder of the music"
echo " -t, --temp <folder> The temporary cache for converted files (default: /tmp/converted)"
echo " -c, --convert Convert files before syncing"
echo " -a, --convert-art <width> Convert album-art before syncing (default width: 200)"
echo " -b, --bitrate When converting use this bitrate"
echo " -c, --convert <bitrate> Convert files to a given bitrate in kbps before syncing (default: 192)"
echo " -a, --resize-art <width> 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 ""