spikes/bending/Sources/Bending/main.swift

00ea029d0652da12d0f4237769e7020b72cfa7f3
fold/spikes/bending/Sources/Bending/main.swift history · blame · raw

18 lines · 493 bytes

 1import Foundation
 2setvbuf(stdout, nil, _IOLBF, 0)
 3
 4// swift run -c release --package-path spikes/bending [case]
 5let cases: [(String, () throws -> Void)] = [
 6    ("mesh", meshCase),
 7    ("crane", craneCase),
 8    ("stages", craneStagesCase),
 9    ("pop", popCase),
10    ("sampan", sampanCase),
11    ("sampanpath", sampanPathCase),
12    ("sampanbend", sampanBendCase),
13]
14
15let only = CommandLine.arguments.dropFirst().first
16for (name, run) in cases where only == nil || only == name {
17    try run()
18}