Skip to content

Instantly share code, notes, and snippets.

@sturdysturge
Last active Dec 23, 2020
Embed
What would you like to do?
Command Line Tool that prints passed arguments
import Foundation
print("Launch arguments:")
var arguments = CommandLine.arguments
if arguments.count > 0 {
print("Launch arguments:")
for argument in arguments {print(argument)}
}
print("This tool keeps repeating your input until your input is the word quit")
var inputString = String()
while inputString != "quit"
{
inputString = readLine()!
print("You said: \(inputString)")
}
print("The program has ended")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment