Skip to content

Instantly share code, notes, and snippets.

@keitaito
Last active January 16, 2017 07:48
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 keitaito/04fc589b292d00f3a06b4a5b2d1a07bc to your computer and use it in GitHub Desktop.
Save keitaito/04fc589b292d00f3a06b4a5b2d1a07bc to your computer and use it in GitHub Desktop.
// Add Foundation import to be able to use NSDate class below.
import Foundation
print("Hello, world!")
// There is always one argument passed, which is the name of the program,
// that is the file name.
if CommandLine.argc < 2 {
print("No arguments are passed.")
let firstArgument = CommandLine.arguments[0]
print(firstArgument)
} else {
print("Arguments are passed.")
let arguments = CommandLine.arguments
for argument in arguments {
print(argument)
}
}
let today = NSDate()
print(today)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment