Skip to content

Instantly share code, notes, and snippets.

@kimar
Created June 25, 2015 10:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kimar/d411f5feed2bb3549237 to your computer and use it in GitHub Desktop.
Save kimar/d411f5feed2bb3549237 to your computer and use it in GitHub Desktop.
More advanced Hello World Swift CLI App
#!/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