init(name:inversion:exclusivity:help:)

Creates a Boolean property that reads its value from the presence of one or more inverted flags.

Flag.swift:218
init(name: NameSpecification = .long, inversion: FlagInversion, exclusivity: FlagExclusivity = .chooseLast, help: ArgumentHelp? = nil)

Parameters

name

A specification for what names are allowed for this flag.

inversion

The method for converting this flags name into an on/off pair.

exclusivity

The behavior to use when an on/off pair of flags is specified.

help

Information about how to use this flag.

Use this initializer to create an optional Boolean flag with an on/off pair. With the following declaration, for example, the user can specify either --use-https or --no-use-https to set the useHTTPS flag to true or false, respectively. If neither is specified, the resulting flag value would be nil.

@Flag(inversion: .prefixedNo)
var useHTTPS: Bool?