Skip to content

Commit

Permalink
Document SbtMain
Browse files Browse the repository at this point in the history
  • Loading branch information
daddykotex authored and tgodzik committed Sep 27, 2022
1 parent 3817567 commit 87a2df6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mdoc/src/main/scala/mdoc/Main.scala
Expand Up @@ -17,6 +17,13 @@ object Main extends MainProcess {
}
}

/** This main is meant to be called from a running JVM. Rather than exiting with a non-zero code on
* error, it will throw an exception. This is useful when calling from another JVM and you don't
* want this JVM to exit and mdoc fails.
*
* This is the case for the `sbt` integration. When an exception is raised, `sbt` will make the
* task as failed but won't exit. This provides a better user experience.
*/
object SbtMain extends MainProcess {
def main(args: Array[String]): Unit = {
val code = process(args, System.out, PathIO.workingDirectory.toNIO)
Expand Down

0 comments on commit 87a2df6

Please sign in to comment.