Skip to content

Commit b08781f

Browse files
committed
Add error property to Abort
1 parent b4893c8 commit b08781f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

clikt/src/main/kotlin/com/github/ajalt/clikt/core/exceptions.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ import com.github.ajalt.clikt.parameters.arguments.Argument
44
import com.github.ajalt.clikt.parameters.arguments.convert
55
import com.github.ajalt.clikt.parameters.options.Option
66

7-
/** An internal error that signals Clikt to abort. */
8-
class Abort : RuntimeException()
7+
/**
8+
* An internal error that signals Clikt to abort.
9+
*
10+
* @property error If true, print "Aborted" and exit with an error code. Otherwise, exit with no error code.
11+
*/
12+
class Abort(val error: Boolean = true) : RuntimeException()
913

1014
/**
1115
* An exception during command line processing that should be shown to the user.

0 commit comments

Comments
 (0)