Skip to content

Instantly share code, notes, and snippets.

@PaulWoodIII
Created October 9, 2016 23:04
Show Gist options
  • Select an option

  • Save PaulWoodIII/d6c1f30a56ac14558ce79a94c50353ae to your computer and use it in GitHub Desktop.

Select an option

Save PaulWoodIII/d6c1f30a56ac14558ce79a94c50353ae to your computer and use it in GitHub Desktop.
#!/usr/bin/env xcrun swift
import Foundation
print("This is a swift script!")
print("Arguments: \(ProcessInfo.processInfo.arguments)")
@PaulWoodIII
Copy link
Author

usage might be like ./myScriptName.swift -- a b c d.

Update to Swift 3
Thanks to Erica Sadun for this little snippet I like the usage of swift for scripting some things like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment