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
{{ message }}
Repository navigation
Add conformances to support Swift ArgumentParser? #88
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){iflet p =Path(argument){self= p
}else{returnnil}}}
but the ExpressibleByArgument conformance seems clunky to me.
Activity
JetForMe commentedon Jan 7, 2022
Oh oops never mind,
ExpressibleByArgumentis part ofArgumentParser, not Swift.mxcl commentedon Jan 10, 2022
In general: happy to accept PRs for additions that make sense