The markdown parsing is broken/disabled for release notes. Sorry about that, I'm chasing the source of a crash that's been bringing this website down for the last couple of days.
* Updated to Linux-compatible package structure
* Fixed crash when no arguments passed
Test structure
* Added tests placeholder
* Manifest fix
* Extensible `CommandName`, `ArgumentName` and `OptionName` structs, used in the same way as Foundation's `Notification.Name`.
* Parsed models use dictionaries with the related name struct as the key.
* Parser fix
* Package manifest fix
* Re-write of whole project. Simplified parser. Commands are now built using a CommandBuilder.
* Update to Swift 5
Initial 1.0 Release
6 years ago
`CommandParser.parseCommandLine(_:)` no longer throws. Instead, you can handle parsing errors in a new CommandParserDelegate function, `parserError(_:)`. This makes it easy to run parsing in a background thread and for better separation of concerns.
```swift
class Delegate : CommandParserDelegate {
/**
Called if there was a problem.
*/
func parserError(error : CommandParserError) {
//Handle error
}
/**
Called if there were no command-line arguments supplied to your program.
*/
func commandNotSupplied() {
//Handle commands not supplied
}
/**
Called if a command was parsed successfully.
*/
func receivedCommand(command : Command) {
//Handle successfully-parsed commands
}
}
let delegate = Delegate()
let commandParser = CommandParser()
commandParser.parseCommandLine(delegate: delegate)
```