File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Sources/ArgumentParser/Parsable Types Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -84,18 +84,24 @@ extension ParsableCommand {
8484 }
8585
8686 /// Parses an instance of this type, or one of its subcommands, from
87- /// command-line arguments and calls its `run()` method, exiting cleanly
88- /// or with a relevant error message.
87+ /// the given arguments and calls its `run()` method, exiting with a
88+ /// relevant error message if necessary .
8989 ///
9090 /// - Parameter arguments: An array of arguments to use for parsing. If
9191 /// `arguments` is `nil`, this uses the program's command-line arguments.
92- public static func main( _ arguments: [ String ] ? = nil ) -> Never {
92+ public static func main( _ arguments: [ String ] ? ) {
9393 do {
9494 let command = try parseAsRoot ( arguments)
9595 try command. run ( )
96- exit ( )
9796 } catch {
9897 exit ( withError: error)
9998 }
10099 }
100+
101+ /// Parses an instance of this type, or one of its subcommands, from
102+ /// command-line arguments and calls its `run()` method, exiting with a
103+ /// relevant error message if necessary.
104+ public static func main( ) {
105+ self . main ( nil )
106+ }
101107}
You can’t perform that action at this time.
0 commit comments