Skip to content

Commit 6f077c5

Browse files
committed
Small fixes
Signed-off-by: Marcin Kuszczak <[email protected]>
1 parent ea5ad84 commit 6f077c5

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

README.adoc

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,27 +51,26 @@ To use `kscript` just Kotlin is required.
5151
To https://kotlinlang.org/docs/tutorials/command-line.html[install Kotlin] we
5252
recommend http://sdkman.io/install[sdkman]:
5353

54+
[source,bash]
5455
----
5556
curl -s "https://get.sdkman.io" | bash # install sdkman
5657
source "$HOME/.sdkman/bin/sdkman-init.sh" # add sdkman to PATH
5758
5859
sdk install kotlin # install Kotlin
59-
6060
----
6161

6262
Once Kotlin is ready, you can install `kscript` with
6363

64+
[source,bash]
6465
----
6566
sdk install kscript
66-
6767
----
6868

6969
To test your installation simply run
7070

7171
[source,bash]
7272
----
7373
kscript --help
74-
7574
----
7675

7776
This will check and inform about updates. To update `kscript` simply install it again as described above.
@@ -87,15 +86,13 @@ docker run -i holgerbrandl/kscript 'println("Hello, world!")'
8786
8887
# or using versioned container
8988
docker run -i holgerbrandl/kscript:2.9.3 'println("Hello, world!")'
90-
9189
----
9290

9391
To use a script file outside the container as input, you could do
9492

9593
[source,bash]
9694
----
9795
docker run -i holgerbrandl/kscript - < script.kts
98-
9996
----
10097

10198
This will make `kscript` read the code from stdin while piping the file. Beware that the -i flag is needed to have
@@ -134,7 +131,7 @@ On Arch Linux, `kscript` is available through
134131
the https://aur.archlinux.org/packages/kscript/[Arch Linux User repository (AUR)]. Use your
135132
favorite https://wiki.archlinux.org/index.php/AUR_helpers[AUR helper] to install, e.g. `yay`:
136133

137-
[source,shell]
134+
[source,bash]
138135
----
139136
yay -S kscript
140137
----
@@ -145,7 +142,7 @@ Two workarounds for ArchLinux exists, which can be used to make 'kscript' workin
145142

146143
. Manually create symlinks in the system…
147144
+
148-
[source,shell]
145+
[source,bash]
149146
----
150147
sudo mkdir /usr/share/kotlin/bin
151148
sudo ln -s /usr/bin/kotlin /usr/share/kotlin/bin/kotlin
@@ -173,9 +170,9 @@ To build `kscript` yourself, simply clone the repo and do
173170

174171
== Script Input Modes
175172

176-
The main mode of operation is `kscript &lt;script&gt;`.
173+
The main mode of operation is `kscript <script>`.
177174

178-
The `&lt;script&gt;` can be a Kotlin `*.kts` script file , a script URL, `-` for stdin, a process substitution file handle,
175+
The `<script>` can be a Kotlin `*.kts` script file , a script URL, `-` for stdin, a process substitution file handle,
179176
a `*.kt` source file with a main method, or some kotlin code.
180177

181178
=== Interpreter Usage
@@ -198,12 +195,14 @@ To use `kscript` in a workflow without creating an additional script file, you c
198195
for _inlined usage_. The following modes are supported:
199196

200197
* Directly provide a Kotlin scriptlet as argument
198+
201199
[source,bash]
202200
----
203201
kscript 'println("hello world")'
204202
----
205203

206204
* Pipe a Kotlin snippet into `kscript` and instruct it to read from `stdin` by using `-` as script argument
205+
207206
[source,bash]
208207
----
209208
echo 'println("Hello Kotlin.")' | kscript -
@@ -219,6 +218,7 @@ EOF
219218
----
220219

221220
* Since the piped content is considered as a regular script it can also have dependencies
221+
222222
[source,bash]
223223
----
224224
kscript - <<"EOF"
@@ -232,7 +232,7 @@ EOF
232232
----
233233

234234
* Finally, (for sake of completeness), it also works with process substitution and for sure you can always provide
235-
additional arguments (exposed as `args : Array&lt;String&gt;` within the script)
235+
additional arguments (exposed as `args : Array<String>` within the script)
236236

237237
[source,bash]
238238
----
@@ -466,7 +466,7 @@ cat some_file | kscript -t 'lines
466466
----
467467

468468
In this example, the extension
469-
method https://github.com/holgerbrandl/kscript-support-api/blob/master/src/main/kotlin/kscript/text/StreamUtil.kt#L34[`Iterable&lt;String&gt;.print()`]
469+
method https://github.com/holgerbrandl/kscript-support-api/blob/master/src/main/kotlin/kscript/text/StreamUtil.kt#L34[`Iterable<String>.print()`]
470470
to print the lines to stdout comes from the support API. The rest is stdlib Kotlin.
471471

472472
For more examples using the support library see
@@ -516,7 +516,7 @@ Welcome to Kotlin version 1.1.51 (JRE 1.8.0_151-b12)
516516

517517
Artifacts and versions will differ between scripts, so it is hard to maintain them all in a single project. To
518518
nevertheless provide optimal tooling when scripting with Kotlin `kscript` allows to create temporary projects
519-
for `&lt;script&gt;` arguments.
519+
for `<script>` arguments.
520520

521521
[source,bash]
522522
----
@@ -525,7 +525,7 @@ kscript --idea CountRecords.kts
525525

526526
If you have available `gradle` in the path project will be automatically built and if there is `idea` in the path
527527
the project will be opened in https://www.jetbrains.com/idea/[IntelliJ IDEA] with a minimalistic project containing
528-
just your (1) `&lt;script&gt;` and (2) a generated `build.gradle.kts` file:
528+
just your (1) `<script>` and (2) a generated `build.gradle.kts` file:
529529

530530
image:misc/readme_images/minus_idea.png[]
531531

0 commit comments

Comments
 (0)