Update error handlers
This commit is contained in:
parent
8fdd1ef3d0
commit
550d0aac16
10
convert-psp
Normal file → Executable file
10
convert-psp
Normal file → Executable file
@ -5,11 +5,19 @@ f_convert-psp(){
|
||||
}
|
||||
|
||||
help(){
|
||||
printf "Usage: $0 \"directory\" \"URL\"\n"
|
||||
printf "Usage: $0\n"
|
||||
exit 1
|
||||
}
|
||||
|
||||
nojson(){
|
||||
printf "This program needs a configuration file, named \"subscriptions.json\".\n"
|
||||
printf "Please create this file first.\n"
|
||||
printf "See the readme for instructions on how to create it.\n"
|
||||
exit 1
|
||||
}
|
||||
|
||||
[[ "$1" == "-h" || "$1" == "--help" ]] && help
|
||||
[ ! -f subscriptions.json ] && nojson
|
||||
|
||||
saveifs=$IFS
|
||||
IFS=$'\n'
|
||||
|
Loading…
x
Reference in New Issue
Block a user