Created
June 25, 2015 10:34
-
-
Save kimar/d411f5feed2bb3549237 to your computer and use it in GitHub Desktop.
More advanced Hello World Swift CLI App
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/xcrun swift | |
import AppKit | |
struct Hello { | |
static func talk (name: String!) { | |
println("Hello \(name)!") | |
} | |
} | |
if Process.arguments.count < 1 { | |
println("Missing Argument! Sample: \"./hello_name.swift Marcus\"") | |
exit(1); | |
} | |
Hello.talk(Process.arguments[1]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment