Static Methodswift-argument-parser 1.5.0ArgumentParser
main(_:)
Executes this command, or one of its subcommands, with the given arguments.
- iOS
- 13+
- macOS
- 10.15+
- Mac Catalyst
- 13+
- tvOS
- 13+
- watchOS
- 6+
static func main(_ arguments: [String]?) async
Parameters
- arguments
An array of arguments to use for parsing. If
arguments
isnil
, this uses the program’s command-line arguments.
This method parses an instance of this type, one of its subcommands, or another built-in AsyncParsableCommand
type, from command-line (or provided) arguments, and then calls its run()
method, exiting with a relevant error message if necessary.