Skip to content

Commit e94be40

Browse files
committed
Merge pull request #18 from neonichu/fix-usage-error-crash
Fix a potential crash when `UsageError` is thrown
2 parents ba34fde + f116e85 commit e94be40

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Sources/CommandRunner.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ extension CommandType {
3434
let help = Help([], command: usage, group: group)
3535
fputs("\(help)\n", stderr)
3636
exit(1)
37+
} catch let error as UsageError {
38+
fputs("\(error)\n", stderr)
39+
exit(1)
3740
} catch {
3841
fputs("\(error)\n", stderr)
3942
exit(1)

0 commit comments

Comments
 (0)