Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
build.sh: use long commands only
Browse files Browse the repository at this point in the history
Signed-off-by: Maxim Polyakov <[email protected]>
  • Loading branch information
maxpoliak committed Oct 5, 2021
1 parent 228d331 commit cb81e07
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 29 deletions.
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,20 @@ Make some preparations once before start the building process:
git clone https://github.com/maxpoliak/rtems-ec-cli.git && cd rtems-ec-cli && ./preparations.sh
```

Use the help to print all the available options:
Use the help to print all the available commands:

```
./build.sh help
```
```
Use ./build.sh [OPTIONS...]
Use $0 [OPTIONS...]"
-a | all Build all: cross-compiler, RTEMS OS and ile-cli application
rtems Build RTEMS OS
cross Build cross-compiler
-C | cleanall Clear all
-r | rebuild Set rebuild flag
Delete the application's object files before building it
-h | help Print help
Use ./build.sh [COMMANDS...]
all Build all: cross-compiler, RTEMS OS and ile-cli application
rtems Build RTEMS OS
cross Build cross-compiler
cleanall Clear all
rebuild Set rebuild flag
Delete the application's object files before building it
help Print help
```

For the first build, use the build script with the "-a" or "all" option to build
Expand Down
32 changes: 13 additions & 19 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,54 +78,48 @@ function build_application

function print_help
{
echo "Use $0 [OPTIONS...]"
echo " -a | all Build all: cross-compiler, RTEMS OS and ile-cli application"
echo " rtems Build RTEMS OS"
echo " cross Build cross-compiler"
echo " -C | cleanall Clear all"
echo " -r | rebuild Set rebuils flag"
echo " Delete the application's object files before building it"
echo " -h | help Print help"
echo "Use $0 [COMMANDS...]"
echo " all Build all: cross-compiler, RTEMS OS and ile-cli application"
echo " rtems Build RTEMS OS"
echo " cross Build cross-compiler"
echo " cleanall Clear all"
echo " rebuild Set rebuils flag"
echo " Delete the application's object files before building it"
echo " help Print help"
}

while [ "${1:-}" != "" ]; do
case "$1" in
"-a" | "all")
"all")
FLAG_BUILD_ALL=1
shift
break
;;
"rtems")
FLAG_BUILD_RTEMS=1
shift
break
;;
"cross")
FLAG_BUILD_CROSS=1
shift
break
;;
"-C" | "cleanall")
"cleanall")
FLAG_CLEAR_ALL=1
shift
break
;;
"-r" | "rebuild")
"rebuild")
FLAG_REBUILD_APP=1
shift
break
;;
"-h" | "help")
"help")
print_help
exit 0
;;
*)
echo "invalid command or option ($1)"
echo "invalid command ($1)"
print_help
exit 1
;;
esac
shift
done

if [[ ${FLAG_CLEAR_ALL} -eq 1 ]] ; then
Expand Down

0 comments on commit cb81e07

Please sign in to comment.