diff --git a/build.sh b/build.sh index 6fd88fa6..87389b64 100755 --- a/build.sh +++ b/build.sh @@ -177,6 +177,15 @@ uninstall() { rm -fv "/usr/bin/mangohud.x86" } +usage() { + if test -z $1; then + echo "Unrecognized command argument: $a" + else + echo "$0 requires at least one argument" + fi + echo 'Accepted arguments: "pull", "configure", "build", "package", "install", "clean", "uninstall".' +} + for a in $@; do case $a in "") build;; @@ -189,7 +198,11 @@ for a in $@; do "uninstall") uninstall;; "release") release;; *) - echo "Unrecognized command argument: $a" - echo 'Accepted arguments: "pull", "configure", "build", "package", "install", "clean", "uninstall".' + usage esac done + +if test -z $@; then + usage no-args +fi +