Skip to content

Commit 769b56f

Browse files
committed
readme
1 parent 76bd228 commit 769b56f

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ The below features are all demonstrated using the REPL but also work when runnin
107107

108108
### execute code at the start with `--runBefore`
109109
```
110-
./srp --runBefore 'import Byte.MaxValue'
110+
./srp --runBefore "import Byte.MaxValue"
111111
112112
scala> MaxValue
113113
val res0: Int = 127
@@ -116,7 +116,7 @@ val res0: Int = 127
116116
You can specify this parameter multiple times, the given statements will be executed in the given order.
117117

118118
If you want to execute some code _every single time_ you start a session, just write it to `~/.scala-repl-pp.sc`
119-
```
119+
```bash
120120
echo 'import Short.MaxValue' > ~/.scala-repl-pp.sc
121121

122122
./srp
@@ -125,6 +125,15 @@ scala> MaxValue
125125
val res0: Int = 32767
126126
```
127127

128+
If the code you want to execute on startup is in a file, you can use your shell tooling:
129+
```bash
130+
echo 'import Int.MaxValue' > /tmp/runBeforeFile.sc
131+
./srp --runBefore "$(cat /tmp/runBeforeFile.sc)"
132+
133+
scala> MaxValue
134+
val res0: Int = 2147483647
135+
```
136+
128137
### `--predef`: add source files to the classpath
129138
Additional source files that are compiled added to the classpath, but unlike `runBefore` not executed straight away can be provided via `--predef`.
130139
```

0 commit comments

Comments
 (0)