Update error handlers

This commit is contained in:
Michael De Roover 2023-04-19 22:32:49 +02:00
parent 8fdd1ef3d0
commit 550d0aac16
Signed by: vim
GPG Key ID: 075496E232CE04CB

10
convert-psp Normal file → Executable file
View 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'