Skip to content

Commit 3889437

Browse files
committed
clarified class file usage with kscript to avoid confusion as in #31
1 parent 7057a15 commit 3889437

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,16 @@ println("Hello from Kotlin with 5g of heap memory running in server mode!")
186186
```
187187

188188

189+
### Scripts with a main method do not run with `kscript`?
190+
191+
There is [no need](https://kotlinlang.org/docs/tutorials/command-line.html#using-the-command-line-to-run-scripts) for a main method in a Kotlin script. Kotlin kts scripts can be more simplistic compared regular kotlin `*.kt` source files and work without a main method by directly running the provided code. E.g.
192+
```
193+
print("hello kotlin!")
194+
```
195+
is a valid Kotlin `kts` script.
196+
197+
Regular class files are not supported [yet](https://github.com/holgerbrandl/kscript/issues/31#issuecomment-309976103) by `kscript`. This is because a `kt` Kotlin source file might contain multiple classes with a main method in each, so the entry point might not be always clearly defined. (see #31)
198+
189199
Support
190200
-------
191201

0 commit comments

Comments
 (0)