[swift-users] ProcessInfo arguments when running as a script?
jon at jonshier.com
Thu Aug 18 22:28:10 CDT 2016
You’re quite right. I knew something had been renamed but between Process and ProcessInfo I lost my way.
> On Aug 18, 2016, at 11:05 PM, Jordan Rose <jordan_rose at apple.com> wrote:
> I’d be surprised if the behavior of ProcessInfo has actually changed. Swift.CommandLine (formerly Swift.Process, unrelated to ProcessInfo) should have the script arguments only.
>> On Aug 18, 2016, at 19:14, Jon Shier via swift-users <swift-users at swift.org> wrote:
>> 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?)?
>> swift-users mailing list
>> swift-users at swift.org
More information about the swift-users