2
0
Эх сурвалжийг харах

Make help and usage setup standards-compliant

Joshua Boniface 6 жил өмнө
parent
commit
bc18d5341c
1 өөрчлөгдсөн 6 нэмэгдсэн , 0 устгасан
  1. 6 0
      build

+ 6 - 0
build

@@ -32,7 +32,13 @@ usage() {
     echo -e "Build output files are collected at '../jellyfin-build/<platform>'."
 }
 
+# Show usage on stderr with exit 1 on argless
 if [[ -z $1 ]]; then
+    usage >&2
+    exit 1
+fi
+# Show usage if -h or --help are specified in the args
+if [[ $@ =~ '-h' || $@ =~ '--help' ]]; then
     usage
     exit 0
 fi