From b69f495a3db39f359f2b21e79038c3750f6b133e Mon Sep 17 00:00:00 2001 From: b1ek Date: Wed, 23 Aug 2023 01:09:32 +1000 Subject: [PATCH] add guide to install as a cli --- README.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c66bb24..4d77d54 100644 --- a/README.md +++ b/README.md @@ -24,4 +24,22 @@ Example code: eval(&"++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.").unwrap(); ``` -Also check out `examples/` directory \ No newline at end of file +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 +``` \ No newline at end of file