Scoop API

scoop:scoop.cli:0.1.0

src/annotations.scoop

Selected production source · src/annotations.scoop

1package scoop.cli
3/**
4 * Describes a named value option on a field or property. Help-related text only affects
5 * presentation; missing values use the model constructor's defaults.
6 */
7@Target([AnnotationTarget.Field, AnnotationTarget.Property])
8public annotation class CliOption(
9 val names: Array<String> = [], val help: String = "",
10 val valueName: String = "", val defaultText: String = "", val required: Boolean = false
13/**
14 * Describes positive and optional negative spellings for a Boolean field or property. Flags
15 * consume no separate value token.
16 */
17@Target([AnnotationTarget.Field, AnnotationTarget.Property])
18public annotation class CliFlag(
19 val names: Array<String> = [], val negativeNames: Array<String> = [],
20 val help: String = "", val defaultText: String = "", val required: Boolean = false
23/**
24 * Assigns a field or property a zero-based positional argument index and its help presentation.
25 */
26@Target([AnnotationTarget.Field, AnnotationTarget.Property])
27public annotation class CliArgument(
28 val position: Long, val help: String = "", val valueName: String = "", val defaultText: String = "", val required: Boolean = false
31/** Exclude this member from the generated argument layout. */
32@Target([AnnotationTarget.Field, AnnotationTarget.Property])
33public annotation class CliIgnore
35internal fun configuration(message: String): Nothing = throw IllegalArgumentException(Some(message))