I created a "Shebang" swift script.
I am parsing the input arguments using Process.arguments
How can I read the "piped" information in the case it was piped into the script?
#!/usr/bin/env xcrun swift
import Foundation
for argument in Process.arguments {
// parse the input arguments
}
// if the input is piped into the script?:
// if PIPE??? {
print("Handling pipe")
let pipe = NSPipe()
let handle = pipe.fileHandleForReading
let data = handle.readDataToEndOfFile()
print("End of pip")
}