You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Swift ArgumentParser library makes it easy to parse command-line arguments. I feel like it should be possible to directly provide a Path argument:
structCalculate:ParsableCommand{@Option(name:.shortAndLong, help:"Path to input word list, one per line")varinputWordList:Path=Path.cwd/"wordlist.txt"}extensionPath:ExpressibleByArgument{publicinit?(argument:String){
if let p =Path(argument){self= p
}else{returnnil}}}
but the ExpressibleByArgument conformance seems clunky to me.
The text was updated successfully, but these errors were encountered:
The Swift ArgumentParser library makes it easy to parse command-line arguments. I feel like it should be possible to directly provide a
Path
argument:but the
ExpressibleByArgument
conformance seems clunky to me.The text was updated successfully, but these errors were encountered: