This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env xcrun -sdk macosx swift | |
// Displays UI in an NSWindow which can interact with the commandline | |
// Usage: `echo "Bar" | ./swift-ui-commandline-tool.swift` | |
import Foundation | |
import SwiftUI | |
extension CommandLine { | |
static let input: String = { AnyIterator { readLine() }.joined() }() |