Note: For the commands that follow, it is assumed that you are in the root directory of the project in your favorite terminal application.
Run .\gradlew.bat bootJar
(or .\gradlew bootJar
if you're on a Mac) to build and assemble an executable Spring Boot JAR with all of its dependencies.
- Run
java -jar .\build\libs\fractions-0.0.1-SNAPSHOT.jar
.- Ensure
java
is on your terminal'sPath
.
- Ensure
- This will start Spring Boot and bring up the shell prompt. Like this:
shell:>
. - The only command that is supported right now is the
calculate
command. - Here are some examples for running the calculate command:
Use a space to separate operands and the operator. Multiple continuous spaces are handled by the application.
shell:>calculate "1 + 1/2"
shell:>calculate " 1 - 2/3"
shell:>calculate "2_2/3 + 9_9/2"
shell:>calculate "1/2 + 1/2"
- Supply only two operands at most, with one of the operators:
+, -, /, *
- To enter mixed fractions, enter them as
wholeNumber_numerator/denominator
.- For example,
3_1/3
.
- For example,
- Improper fractions, i.e.,
16/5
, and whole numbers are allowed. - Integers in the negative range are allowed as well.
- Plus, all of the features that Spring Shell provides.