[swift-users] ProcessInfo arguments when running as a script?

Jon Shier jon at jonshier.com
Thu Aug 18 21:14:12 CDT 2016

Swift Users:
	I’m trying to parse the command-line arguments of a Swift 3 script using Xcode 8 beta 6. However, ProcessInfo’s arguments array now contains all of the swift compiler arguments as well as the command itself. For example, this script:

#!/usr/bin/env swift

import Foundation


now prints:


(arguments broken into lines for readability)

Is this a bug (and if so, does it need to be reported) or is it an intentional change (if so, how are we supposed to parse arguments now?)?


More information about the swift-users mailing list