Return the full list of arguments as it was passed on the command line.
Return the full list of arguments as it was passed on the command line. It is rarely needed and param (with a range) is usually preferred.
Starting point for a command line interface specification.
Starting point for a command line interface specification. The Command instance describes details that apply to the whole command like header and description, for example. A Command instance itself does not fully specify the CLI, a CommandLine has to be added to it to be able to function as a full command line spec. The CommandLine can be added by simply applying the command to a CommandLine instance. Example:
command.header("My command") { for { level <- opt("level", "prod") .... } yield ... } }
Starting point for a command line interface specification.
Starting point for a command line interface specification. The Command instance describes details that apply to the whole command like header and description, for example. A Command instance itself does not fully specify the CLI, a CommandLine has to be added to it to be able to function as a full command line spec. The CommandLine can be added by simply applying the command to a CommandLine instance. Example:
command.header("My command") { for { level <- opt("level", "prod") .... } yield ... } }
Directly specify an IO result in the command line processing context.
Directly specify an IO result in the command line processing context. Lifts an IO into the CommandLineArgSpec monad context without any command line specification or argument processing taking place. Useful, for example, in the edge case when a command has no options yet but some header and description are already specified. An IO can be implicitly lifted into the CommandLineArgSpec context if the Sclap implicits are imported.
Specifies a command line option with the given name.
Specifies a command line option with the given name. The option is optional: it can be omitted on the command line and the result is of type Option[T].
The type of the option value.
Adds an existing command as a subcommand in the current command line context.
Adds an existing command as a subcommand in the current command line context. More technically, it lifts an existing command as a subcommand with the given name into the current command line context. Commands can be freely combined with each other using subcommands. Because of referential transparency and the hierarchic structure of subcommands, the same command definition can be reused or even serve both as a subcommand and as a main command in different contexts.
Takes a non-empty list of subcommands and returns the IO result of the first one that returns a non-error result when processing the arguments.
Takes a non-empty list of subcommands and returns the IO result of the first one that returns a non-error result when processing the arguments. For example,
for { r <- subcommands(sub1, sub2, sub3) } yield r
is equivalent to
for { r1 <- sub1 r2 <- sub2 r3 <- sub3 } yield r1 orElse r2 orElse r3
and so on. It is effectively a way to select the subcommand that is invoked on the command line.