| Crates.io | cl-calc |
| lib.rs | cl-calc |
| version | 1.0.2 |
| created_at | 2023-04-20 03:43:39.142006+00 |
| updated_at | 2023-04-21 04:05:05.783568+00 |
| description | A command line calculator. |
| homepage | |
| repository | https://github.com/TheDrJosh/cl-calc |
| max_upload_size | |
| id | 844098 |
| size | 28,463 |
CL Calc is command line calculator that I made as a side project to learn to make a interpreter. It is messy and inefficient but is a fun proof of concept.
To install you can either:
cargo install cl-calcRunning the program with no arguments allows you to enter commands line by line similar to how node works. Run with a path as the first argument to run the commands in that file. (I use .calc but is doesn't matter).
The valid options are:
--help which can also be accessed with -? and -h--version which can also be accessed with -v--aboutThere command that you can use while typing into the command line to they are prefixed with a ! and are.
!exit!help!vars!file \<path>
This will execute all of the commands in a file!out \<path>
This will output all successfully run commands to a fileThe ! commands do not work in a file.
When running a file you can put a ! at the start of the line to have it output as well. Only the last line will be put into ans. This works when running a file as an argument and in the cli.