parse()

Parses multiple arguments by name to a Swift value.

Declaration

func parse <each T>() throws -> (
    repeat each T
) where repeat each T: Parsable

Throws

A TypeError if the arguments don’t match or a conversion error from from(pythonObject:interpreter:).

Returns

A variadic generic tuple of Swift values.

Discussion

It needs the called method to have an explicit signature and throws an error if the conversion failed or the method got unexpected arguments.

Usage

let (string, integer): (String, Int) = try argumentParser.parse()