Initializerswift-argument-parser 1.6.1ArgumentParser
init(_:)
NameSpecification.swift:84init<S>(_ sequence: S) where S : Sequence, S.Element == NameSpecification.Element
init<S>(_ sequence: S) where S : Sequence, S.Element == NameSpecification.Element
s14ArgumentParser17NameSpecificationVyACxcSTRzAC7ElementVADRtzlufc
What are these?7JETX
import ArgumentParser
Straightforward, type-safe argument parsing for Swift.
struct NameSpecification
A specification for how to represent a property as a command-line argument label.
protocol Sequence<Element>
A type that provides sequential, iterated access to its elements.
associatedtype Element where Self.Element == Self.Iterator.Element
A type representing the sequence’s elements.
struct Element
An individual property name translation.
init(arrayLiteral elements: NameSpecification.Element...)
static var long: NameSpecification { get }
Use the property’s name converted to lowercase with words separated by hyphens.
static var short: NameSpecification { get }
Use the first character of the property’s name as a short option label.
static var shortAndLong: NameSpecification { get }
Combine the .short
and .long
specifications to allow both long and short labels.
static func customLong(_ name: String, withSingleDash: Bool = false) -> NameSpecification
Use the given string instead of the property’s name.
static func customShort(_ char: Character, allowingJoined: Bool = false) -> NameSpecification
Use the given character as a short option label.