Added style without -s and -d

This commit is contained in:
Jeroen De Meerleer 2018-11-30 11:27:32 +01:00
parent ad75ff4e28
commit 594d6fb157

View File

@ -17,6 +17,10 @@ GetOptions() {
echo "If you're using mac or another unix-like system, please install GNU getopt" echo "If you're using mac or another unix-like system, please install GNU getopt"
exit 1 exit 1
fi fi
# Parsing style without -s or -d
source=${*: -2:1}
dest=${*: -1:1}
OPTIONS=s:d:vh OPTIONS=s:d:vh
LONGOPTS=source:,dest:,verbose,help LONGOPTS=source:,dest:,verbose,help
@ -70,8 +74,10 @@ GetOptions() {
} }
Usage() { Usage() {
echo ""
echo "Usage:" echo "Usage:"
echo "music-sync -s|--source <source> -d|--dest <destination> <parameters>" echo "music-sync <options> -s|--source <source> -d|--dest <destination>"
echo "music-sync <options> <source> <destination>"
echo "" echo ""
echo "Syncronises music from one folder to another." echo "Syncronises music from one folder to another."
echo "" echo ""
@ -92,4 +98,5 @@ VerboseOutput() {
GetOptions $@ GetOptions $@
if [[ "$help" == true ]]; then if [[ "$help" == true ]]; then
Usage Usage
exit
fi fi