Skip to content

Commit

Permalink
build.sh: Add basic usage
Browse files Browse the repository at this point in the history
Signed-off-by: Petr Vorel <pvorel@suse.cz>
  • Loading branch information
pevik committed Apr 16, 2024
1 parent 5062042 commit cdbe141
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,28 @@ print_log()
echo "=== END $log ==="
}

usage()
{
cat << EOF
Usage:
$0 [ build|build-log|check-binaries|configure|dependencies|dist|info|install|install-log|test|test-log ]
$0 { -h|--help|help }
EOF
}

cd `dirname $0`

cmd=
case "${1:-}" in
build|build-log|check-binaries|configure|dependencies|dist|info|install|install-log|test|test-log|"") cmd="${1:-}";;
-h|--help|help|build|build-log|check-binaries|configure|dependencies|dist|info|install|install-log|test|test-log|"") cmd="${1:-}";;
*) echo "ERROR: wrong command '$1'" >&2; exit 1;;
esac

if [ "$cmd" = "help" -o "$cmd" = "--help" -o "$cmd" = "-h" ]; then
usage
fi

if [ -z "$cmd" -o "$cmd" = "dependencies" ]; then
check_build_dependencies
fi
Expand Down

0 comments on commit cdbe141

Please sign in to comment.