-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.swift
49 lines (44 loc) · 900 Bytes
/
main.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//=======================
// Swift Curses Examples
//=======================
func main() throws {
if CommandLine.arguments.count <= 1 {
fatalError("Not enough arguments")
// TODO: TUI for examples
}
let program = CommandLine.arguments[1]
switch program {
case "helloWorld":
try helloWorld()
case "init":
try initUsage()
case "print":
try printExample()
case "input":
try inputExample()
case "attributes":
try attributesExample()
case "chgat":
try chgatExample()
case "window":
try windowExample()
case "moreBorderFuncs":
try borderExample()
case "colors":
try colorsExample()
case "keyboard":
try keyboardExample()
case "mouse":
try mouse()
case "tempLeaveCurses":
try temporarilyLeavingCurses()
default:
print("Invalid program \(program)")
}
}
do {
try main()
} catch {
print("Oops, that's an error:")
print(error)
}