jakeheis / SwiftCLI

A powerful framework for developing CLIs in Swift
MIT License
861 stars 72 forks source link

Key and Param default value #85

Open yonaskolb opened 4 years ago

yonaskolb commented 4 years ago

It would be awesome to have an optional default value for Param and Key. This would allow:

@Key("--type", "-t", description: "The type of dump to output", defaultValue: .yaml)
private var dumpType: DumpType
jakeheis commented 3 years ago

This was near impossible when property wrappers were new and the Swift compiler crashed while doing just about anything with property wrappers. I think it's worth attempting this feature again now in Swift 5.4 though -- will implement when I get a chance