Get command line arguments

 Problem

I want to get the arguments passed to the command line.



 Recipe


// Loop through the command line arguments
// Process.arguments[0] is the Swift script

for arg in Process.arguments {
	print(arg)
}
				

Heard the news?

The Swift Cookbook for Swift 3 is at last here! For iBooks, Kindle and Paperback.
Hurry up - and Check it out! ;-)

 

 Playground