Skip to content

Instantly share code, notes, and snippets.

@seoh
Created July 6, 2014 10:16
Show Gist options
  • Save seoh/5a4af7a5620c294ef27b to your computer and use it in GitHub Desktop.
Save seoh/5a4af7a5620c294ef27b to your computer and use it in GitHub Desktop.
SwimpleServer
#!/usr/bin/env xcrun --sdk macosx10.10 swift -i
import Foundation
println("Usage: \n\t\t\(NSURL(string:__FILE__).lastPathComponent) -- [options]")
// #TODO options
var opt = Dictionary<String, String>()
for arg in Process.arguments {
let array = arg.componentsSeparatedByString("=")
let key: String? = array[0]
let value: String? = array[1]
println(key, value)
}
// .map{ $0.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceCharacterSet()) }
// .filter{ countElements($0) > 0 }
println(opt)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment