diff --git a/README.md b/README.md index bf82cabc..a1ab8e5d 100644 --- a/README.md +++ b/README.md @@ -158,7 +158,7 @@ Options: -f, --file Evaluate a file. -cp, --classpath Classpath to use. -m, --main Call the -main function from namespace with args. - --repl Start REPL + --repl Start REPL. Use rlwrap for history. --socket-repl Start socket REPL. Specify port (e.g. 1666) or host and port separated by colon (e.g. 127.0.0.1:1666). --time Print execution time before exiting. -- Stop parsing args and pass everything after -- to *command-line-args* @@ -541,9 +541,21 @@ bb -cp "src:test:resources" \ (System/exit (+ fail error)))" ``` -## Socket REPL +## REPL -Start the socket REPL like this: +Babashka supports both a REPL and socket REPL. To start the REPL, type: + +``` shell +$ bb --repl +``` + +To get history with up and down arrows, use `rlwrap`: + +``` shell +$ rlwrap bb --repl +``` + +To start the socket REPL you can do this: ``` shellsession $ bb --socket-repl 1666 diff --git a/src/babashka/main.clj b/src/babashka/main.clj index 603862db..9f49f98c 100644 --- a/src/babashka/main.clj +++ b/src/babashka/main.clj @@ -178,7 +178,7 @@ -f, --file Evaluate a file. -cp, --classpath Classpath to use. -m, --main Call the -main function from namespace with args. - --repl Start REPL + --repl Start REPL. Use rlwrap for history. --socket-repl Start socket REPL. Specify port (e.g. 1666) or host and port separated by colon (e.g. 127.0.0.1:1666). --time Print execution time before exiting. -- Stop parsing args and pass everything after -- to *command-line-args*