Package-level declarations

Types

Link copied to clipboard
abstract class Arguments(appName: String = "", appDescription: String? = null, unknownOptionsAsPositionals: Boolean = false, defaultLongPrefix: String = "--", clusterChar: Char? = '-', valueSeparators: Set<Char> = setOf('=', ':'), didYouMean: Boolean = true, didYouMeanMax: Int = 2, aggregateErrors: Boolean = true, maxAggregatedErrors: Int = 20, terminal: Terminal? = null, useANSITerminal: Boolean = true, argumentFilePrefix: Char? = '@', argumentSeparator: String = "|")
Link copied to clipboard

Builder for arity-based list options that return nullable lists of lists.

Link copied to clipboard

Builder for arity-based options that return nullable lists of values.

Link copied to clipboard

Builder for arity-based set options that return nullable sets of lists.

Link copied to clipboard

Abstract base class for collection option builders (List and Set).

Link copied to clipboard

Utilities for generating shell completion scripts from Arguments definitions.

Link copied to clipboard

Builder for creating command-line count options with various configurations and constraints.

Link copied to clipboard

Builder for creating command-line domains (subcommands) with various configurations and constraints.

Link copied to clipboard
object Help

Utilities for generating formatted help text and error messages.

Link copied to clipboard

Builder for arity-based list options that return non-nullable lists of lists.

Link copied to clipboard

Builder for arity-based options that return non-nullable lists of values.

Link copied to clipboard

Builder for arity-based set options that return non-nullable sets of lists.

Link copied to clipboard

Builder for non-nullable command-line options. This type is returned by .default() and .required() to ensure type safety. It delegates most operations to the underlying OptionBuilder while ensuring type safety.

Link copied to clipboard

Builder for creating command-line options with various configurations and constraints.

Link copied to clipboard

Builder for creating command-line list options with various configurations and constraints.

Link copied to clipboard

Builder for creating command-line set options with various configurations and constraints.

Link copied to clipboard
expect object OsBound

Platform abstraction layer providing OS-specific functionality.

actual object OsBound
actual object OsBound
Link copied to clipboard

Exception thrown when argument parsing fails due to invalid input, missing required arguments, or constraint violations.

Link copied to clipboard
data class PasswordConfig(val prompt: String, val confirmPrompt: String, val requireConfirmation: Boolean, val mismatchPrompt: String, val maxRetries: Int)

Configuration for password options.

Link copied to clipboard

Exception thrown when attempting to access an uninitialized property that was declared as non-nullable but no value was provided.

Link copied to clipboard

Enum representing the source of a value for an Argos-managed property.

Functions

Link copied to clipboard

Sets the arity (number of required values) for this option.

Link copied to clipboard

Converts string option to boolean option.

Link copied to clipboard

Converts boolean option to count collector.

Link copied to clipboard

Sets a default value for nullable option, making it non-nullable.

Link copied to clipboard

Converts non-nullable string option to non-nullable double option.

Converts string option to double option.

Link copied to clipboard

Makes boolean option eager (evaluated immediately, causing early exit).

Link copied to clipboard
inline fun <E : Enum<E>> NonNullableOptionBuilder<String>.enum(aliases: Map<String, E> = emptyMap(), ignoreCase: Boolean = true): NonNullableOptionBuilder<E>

Converts non-nullable string option to non-nullable enum option.

inline fun <E : Enum<E>> OptionBuilder<String?>.enum(aliases: Map<String, E> = emptyMap(), ignoreCase: Boolean = true): OptionBuilder<E?>

Converts string option to enum option.

Link copied to clipboard

Converts non-nullable string option to non-nullable float option.

Converts string option to float option.

Link copied to clipboard

Converts non-nullable string option to non-nullable integer option.

Converts string option to integer option.

Link copied to clipboard

Converts option to list collector.

Link copied to clipboard

Converts non-nullable string option to non-nullable long option.

Converts string option to long option.

Link copied to clipboard

Makes a non-nullable boolean option negatable with custom prefix.

Makes this nullable boolean option negatable with a custom prefix. Creates an automatic negation option (e.g., --disable-colors for --colors with prefix "disable-").

@JvmName(name = "negatableNonNull")
fun OptionBuilder<Boolean>.negatable(prefix: String? = null): OptionBuilder<Boolean>

Makes this non-nullable boolean option negatable with a custom prefix. Creates an automatic negation option (e.g., --disable-colors for --colors with prefix "disable-").

Link copied to clipboard

Restricts non-nullable string option to one of the specified allowed values.

fun OptionBuilder<String?>.oneOf(vararg allowed: String, ignoreCase: Boolean = true): OptionBuilder<String?>

Restricts string option to one of the specified allowed values.

Link copied to clipboard
fun <T : Arguments> T.parse(args: Array<String>, onSuccess: (T) -> Unit = {}, onError: (ParseError, T) -> Unit = { _, t -> Help.printError(t) }): T?

Extension function for parsing arguments with error handling.

Link copied to clipboard
fun OptionBuilder<String?>.password(prompt: String = "Password: ", confirmPrompt: String = "Confirm password: ", requireConfirmation: Boolean = false, mismatchPrompt: String = "Passwords do not match. Please try again.", maxRetries: Int = 3): OptionBuilder<CharArray?>

Converts string option to password option with prompting capabilities.

Link copied to clipboard

Marks this option as required.

@JvmName(name = "requiredGeneric")
fun <T : Any> OptionBuilder<T?>.required(): NonNullableOptionBuilder<T>

Marks this nullable option as required, converting it to a non-nullable type.

Link copied to clipboard

Controls whether this option requires a value.

Link copied to clipboard

Converts option to set collector.