counted

fun RawOption.counted(limit: Int = Int.MAX_VALUE, clamp: Boolean = true): OptionWithValues<Int, Int, Int>

Turn an option into a flag that counts the number of times it occurs on the command line.

Parameters

limit

The maximum number of times the option can be given. (defaults to no limit)

clamp

If true, the counted value will be clamped to the limit if it is exceeded. If false, an error will be shown isntead of clamping.