-
-
Save sturdysturge/080864e190e066630811ef741b88e464 to your computer and use it in GitHub Desktop.
Command Line Tool that prints passed arguments
This file contains 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
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