Skip to content

Instantly share code, notes, and snippets.

@imalchenko
Created June 5, 2017 14:18
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 imalchenko/fe95fa90f0fb68dd9a22e91273bad0ea to your computer and use it in GitHub Desktop.
Save imalchenko/fe95fa90f0fb68dd9a22e91273bad0ea to your computer and use it in GitHub Desktop.
Code update for Swift 3
//
// main.swift
// xcodeCli
//
// Created by Ilia Malchenko on 6/5/17.
// Copyright © 2017 M52 Studios, LLC. All rights reserved.
//
import Foundation
let argc : Int = Int(CommandLine.argc) - 1
print("You passed in \(argc) arguments")
let argv : [String] = CommandLine.arguments
for i in 1 ..< (argc + 1) {
print("Argument \(i) was \(argv[i])")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment