Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix help display for non-String RawRepresentables (#494)
RawRepresentable types that have a non-String raw value are having values displayed in the help screen by converting the RawRep value into a string. However, these values are by default parsed by their raw value, so we should use that for display instead. This is accomplished by adding a defaultValueDescription implementation for all ExpressibleByArgument-conforming RawValue types, and then basing the allValues implementation on that. This generalizes the existing overloads for String-based RawRep types, while also allowing users who customize their ExpressibleByArgument implementation to provide the correct help value for clients.
- Loading branch information
1 parent
841b853
commit 774de9c
Showing
3 changed files
with
20 additions
and
6 deletions.
There are no files selected for viewing
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
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
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