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
It would be awesome to have an optional default value for Param and Key. This would allow:
setting the default value in the same place as the rest of the option configuration, instead of down in execute with option ?? defaultValue
allow Param and Key to have non optional types (Param already supports non optional types but currently fails if value not supplied)
allow an option to HelpMessageGenerator that would print the default value of options, perhaps after the description eg: " Defaults to \(defaultValue)"
@Key("--type","-t", description:"The type of dump to output", defaultValue:.yaml)privatevardumpType:DumpType
The text was updated successfully, but these errors were encountered:
yonaskolb
changed the title
Key default value
Key and Param default value
Jan 5, 2020
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
It would be awesome to have an optional default value for
Param
andKey
. This would allow:option ?? defaultValue
" Defaults to \(defaultValue)"
The text was updated successfully, but these errors were encountered: