add guide to install as a cli

This commit is contained in:
b1ek 2023-08-23 01:09:32 +10:00
parent 5049f1d809
commit b69f495a3d
Signed by: blek
GPG Key ID: 14546221E3595D0C
1 changed files with 19 additions and 1 deletions

View File

@ -24,4 +24,22 @@ Example code:
eval(&"++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.").unwrap(); eval(&"++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.").unwrap();
``` ```
Also check out `examples/` directory Also check out `examples/` directory
## Using this as command-line interpreter
There is an example `eval_file`, which you can compile to a standalone binary
```sh
cargo b --release --example=eval_file
cd target/release/examples
# those two are optional, they are needed to reduce the size of binary
# its recommended but if they fail its no big deal
strip eval_file
upx eval_file
cp eval_file /usr/bin/eval_file # or other directory that is in $PATH
hash -r # run this just in case to refresh $PATH in your terminal
eval_file file.b # 1st argument is the name of the file
```