You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`kscript` can be used as a speedier and more flexible substitute for built-in terminal tools such as `awk` or `sed`
320
-
321
-
322
-
`kscript` is complemented by
323
-
324
-
The text processing mode can be enabled with `-t` or `--text`. If so, `kscript` will
319
+
`kscript` can be used as a speedier and more flexible substitute for built-in terminal text tools such as `awk` or `sed`. Its text processing mode can be enabled with `-t` or `--text`. If so, `kscript` will
325
320
326
321
* Declare `com.github.holgerbrandl:kscript-support:1.2.4` as dependency for the script. This [support library](https://github.com/holgerbrandl/kscript-support-api) eases the writing of Kotlin scriptlets for text-processing. It includes solutions to common use-cases like argument parsing, data streaming, IO utilities, and various iterators to streamline the writing of scriptlets for text processing.
327
322
* Import the `kscript.*` namespace
@@ -347,7 +342,7 @@ Treat yourself a REPL with `--interactive`
347
342
348
343
To create an interactive kotlin shell (aka [REPL](https://kotlinlang.org/docs/tutorials/command-line.html#running-the-repl)) with all script dependencies added to the classpath you can use `--interactive`.
349
344
350
-
For example, let's assume the following short script, named `count_records.kts`
345
+
For example, let's assume the following short script, named `CountRecords.kts`
351
346
```kotlin
352
347
#!/usr/bin/env kscript
353
348
@file:DependsOn("de.mpicbg.scicomp:kutils:0.4")
@@ -366,11 +361,11 @@ println(records.count())
366
361
To build a REPL that has the declared artifact in its classpath, we can just do
367
362
368
363
```bash
369
-
kscript --interactive count_records.kts
364
+
kscript --interactive CountRecords.kts
370
365
```
371
366
which will bring up the classpath-enhanced REPL:
372
367
```
373
-
Creating REPL from count_records.kts
368
+
Creating REPL from CountRecords.kts
374
369
Welcome to Kotlin version 1.1.51 (JRE 1.8.0_151-b12)
375
370
>>> import de.mpicbg.scicomp.bioinfo.openFasta
376
371
>>>
@@ -385,6 +380,7 @@ Artifacts and versions will differ between scripts, so it is hard to maintain th
385
380
kscript --idea CountRecords.kts
386
381
```
387
382
This will open [IntelliJ IDEA](https://www.jetbrains.com/idea/) with a minimalistic project containing just your (1) `<script>` and (2) a generated `gradle.build` file:
0 commit comments