Browse Source

Fix bad argument count check

master
cancel 6 years ago
parent
commit
0e8492bb9c
  1. 10
      tool

10
tool

@ -5,10 +5,11 @@ print_usage() {
cat <<EOF cat <<EOF
Usage: tool [options] command [args] Usage: tool [options] command [args]
Commands: Commands:
build <target> build <config> <target>
Compile orca. Compile orca.
Targets: debug, release Configs: debug, release
Default: debug Default: debug
Targets: orca, tui
Output: build/<target>/orca Output: build/<target>/orca
clean clean
Removes build/ Removes build/
@ -22,6 +23,7 @@ Options:
You should probably do this if you plan to give the You should probably do this if you plan to give the
compiled binary to other people. compiled binary to other people.
-s Print statistics about compile time and binary size. -s Print statistics about compile time and binary size.
-g or --debug Build with debug configuration (default)
-h or --help Print this message and exit. -h or --help Print this message and exit.
EOF EOF
} }
@ -233,7 +235,7 @@ case "$1" in
if [[ "$#" -gt 2 ]]; then if [[ "$#" -gt 2 ]]; then
fatal "Too many arguments for 'build'" fatal "Too many arguments for 'build'"
fi fi
if [ "$#" -lt 1 ]; then if [ "$#" -lt 2 ]; then
fatal "Argument required for build target" fatal "Argument required for build target"
fi fi
build_target "$2" build_target "$2"

Loading…
Cancel
Save