Updated docs
This commit is contained in:
parent
14f1dd54bd
commit
b2f66fc057
@ -1,4 +1,38 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
#/
|
||||||
|
#/ Usage:
|
||||||
|
#/ music-sync <options> -s|--source <source> -d|--dest <destination>
|
||||||
|
#/ music-sync <options> <source> <destination>
|
||||||
|
#/
|
||||||
|
#/ Syncronises music from one folder to another.
|
||||||
|
#/
|
||||||
|
#/ Options:
|
||||||
|
#/ -s, --source <source> The source 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 <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)
|
||||||
|
#/ -j, --jobs <nproc> Number of processes to use in multi-threading (default: CPU_CORES - 2)
|
||||||
|
#/ -v, --verbose <0-6> Set log level (default: 2)
|
||||||
|
#/ -h, --help Display this help text
|
||||||
|
#/
|
||||||
|
#/ Log levels:
|
||||||
|
#/ 0 | Verbose
|
||||||
|
#/ 1 | Debug
|
||||||
|
#/ 2 | Info
|
||||||
|
#/ 3 | Warning
|
||||||
|
#/ 4 | Error
|
||||||
|
#/ 5 | Fatal
|
||||||
|
#/ 6 | Silence
|
||||||
|
#/
|
||||||
|
#/ Exit Codes:
|
||||||
|
#/ 1 Dependencies not met
|
||||||
|
#/ 2 Invalid Argument
|
||||||
|
#/ 3 Source Unreachable
|
||||||
|
#/ 4 Destination Unreachable
|
||||||
|
#/ 5 Command failed
|
||||||
|
#/
|
||||||
|
|
||||||
begin=$(date +"%s")
|
begin=$(date +"%s")
|
||||||
# saner programming env: these switches turn some bugs into errors
|
# saner programming env: these switches turn some bugs into errors
|
||||||
@ -14,6 +48,8 @@ convertart=false
|
|||||||
coverartsize=200
|
coverartsize=200
|
||||||
jobcount="-2"
|
jobcount="-2"
|
||||||
multithread=false
|
multithread=false
|
||||||
|
script_name=$(basename "${0}")
|
||||||
|
script_dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||||
|
|
||||||
CheckDeps() {
|
CheckDeps() {
|
||||||
if [[ $1 == 0 ]]; then
|
if [[ $1 == 0 ]]; then
|
||||||
@ -198,38 +234,7 @@ GetOptions() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Usage() {
|
Usage() {
|
||||||
echo ""
|
grep '^#/' "${script_dir}/${script_name}" | sed 's/^#\/\w*//'
|
||||||
echo "Usage:"
|
|
||||||
echo "music-sync <options> -s|--source <source> -d|--dest <destination>"
|
|
||||||
echo "music-sync <options> <source> <destination>"
|
|
||||||
echo ""
|
|
||||||
echo "Syncronises music from one folder to another."
|
|
||||||
echo ""
|
|
||||||
echo "Options:"
|
|
||||||
echo " -s, --source <source> The source 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 <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 ""
|
|
||||||
echo "Log levels:"
|
|
||||||
echo " 0 | Verbose"
|
|
||||||
echo " 1 | Debug"
|
|
||||||
echo " 2 | Info"
|
|
||||||
echo " 3 | Warning"
|
|
||||||
echo " 4 | Error"
|
|
||||||
echo " 5 | Fatal"
|
|
||||||
echo " 6 | Silence"
|
|
||||||
echo ""
|
|
||||||
echo "Exit Codes:"
|
|
||||||
echo " 1 Dependencies not met"
|
|
||||||
echo " 2 Invalid Argument"
|
|
||||||
echo " 3 Source Unreachable"
|
|
||||||
echo " 4 Destination Unreachable"
|
|
||||||
echo " 5 Command failed"
|
|
||||||
echo ""
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VerboseOutput() {
|
VerboseOutput() {
|
||||||
|
Loading…
Reference in New Issue
Block a user