Skip to content

Initializer

init(name:short:help:completion:)

Creates a new Option with the optionType set to .value.
init(name: String, short: Character? = nil, help: String = "", completion: CompletionAction = .default)

Parameters

name

The option’s identifying name that can be passed in to the command call.

short

The short-hand for the flag that can be passed in to the command call.

help

The option’s help text when --help is passed in.

completion

The option’s shell completion action. See CompletionAction for more information and available actions.

Discussion

@Option(name: "verbose", short: "v", help: "Output debug logs")
var verbose: Bool?