bmi-cli v0.2.1
BMI Calculator
A simple CLI tool to calculate your BMI, written in Crystal Lang.
Installation / Development
- Install using
shards install
crystal build src/bmi-cli.cr
mv bmi-cli bin/ && mv bmi-cli.dwarf bin/
Alternatively you can use Cake (Crystal make) by just running cake
Usage
Run bin/bmi-cli --help
to see help screen with all info on it.
This is run simply be accessing the class: BmiValues::Calculate.new(height, weight, units)
You can also use the tool by running a command from the binary you created (and moved). This will work like any old binary. ./bmi-cli
- This will pass in all the defaults through so you can see how it works
You can pass in your own flags to input your own data
./bmi-cli imperial --height=6.5 --weight=190 --name=Jimbob
You can pass in your own flags to input your own data
./bmi-cli metric --height=1.3 --weight=80 --name=Jimbob
This should output something like...
Calculating BMI...
Your BMI is: 20.798816568047336
You're considered: Normal
There's also defaults set so that if a field is missing it'll have something to pass through Right now the defaults are;
units
->"Imperial"
height
->5.11
weight
->180
To see all defaults run bin/bmi-cli --help
.
You can change the output to fit whatever project, like a csv file for example: ./bmi-cli --height=6.5 --weight=190 >> log.csv
Development/Contributing
If you want to contribute, just make a pull request and I'll merge it in if it's relivant. I'd recommend just forking though. Feel free to extend this project however you wish
- Fork it (https://github.com/materialfuture/bmi-cli/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- @MaterialFuture - Creator and Maintainer
Notes
This is still a work in progress, I plan to add some things later on;
- Having option to specify output from the flags
- Verify the metric calculations
- Flag to specify output
- Flag for age
bmi-cli
- 0
- 0
- 0
- 0
- 1
- almost 5 years ago
- October 4, 2019
GNU General Public License v3.0 or later
Sun, 22 Dec 2024 00:44:16 GMT