This is a very basic and simple cli calculator built with Rust, using a guide here.
The application expects a number, an operator, and another number as env arguments.
Usage:
$ ./calculator <number> <operator> <number>
Supported operators:
+
, -
, * | x | X
, /
Simply run cargo build --release
.
A binary file will be created here: ./target/release/calculator
In your terminal run cargo run --
followed by a number, an operator and the second number.
Eg. cargo run -- 2 + 2
After building the application, you can locate the file in ./target/release
folder.
Navigate to ./target/release
and run ./calculator <number> <operator> <number>
Eg.
$ ./target/release/calculator 10 / 8