Commit Graph
4 Commits
Author SHA1 Message Date
Kth d76260e009 [GSoC] Interactive mode should only run in an interactive shell (#485) 2022-09-14 11:15:49 -05:00
Kth aa00bf74fc [GSoC] Add API for disabling interactive mode (#464) 2022-08-15 23:59:50 -05:00
Nate Cook 055e0eaf8c Fix broken links/incorrect variance calculation (#422) 2022-03-15 12:05:09 -05:00
Nate Cook 1141ed1e1b Support an async entry point for commands (#404)
Adds a new `AsyncParsableCommand` protocol, which provides a
`static func main() async` entry point and can call through to the root
command's or a subcommand's asynchronous `run()` method. For this
asynchronous execution, the root command must conform to `AsyncParsableCommand`,
but its subcommands can be a mix of asynchronous and synchronous commands.

Due to an issue in Swift 5.5, you can only use `@main` on an
`AsyncParsableCommand` root command starting in Swift 5.6.
This change also includes a workaround for clients that are using Swift 5.5.
Declare a separate type that conforms to `AsyncMainProtocol` and add the `@main`
attribute to that type.

```
@main enum Main: AsyncMain {
    typealias Command = <#command#>
}
```
2022-03-14 18:14:09 -05:00