Previously, information regarding a custom Option type's possible values was lost when generating subsequent structures in the pipeline to describe the argument. This would largely have to be defined by the user in the discussion string property in ArgumentHelp and would provide no mechanism to directly access the allowable values for a custom Option.
This adds an extra static property on ExpressibleByArgument labelled defaultValueDescriptions, which maps the value name to its description. It is up to the user to implement the defaultValueDescription for their custom CaseIterable type to fully support this behaviour. Further refactoring has been made downstream to the ArgumentDefinition and subsequent structures describing the argument to allow the ability to retrieve the value descriptions from the ExpressibleByArgument type, making information about the property more visible and accessible.
A new enumeration ArgumentDiscussion has been introduced to better encapsulate the discussion information for an argument, and includes cases for discussion sections that contain only static text, as well as cases that include a list of argument values that derive from a type that implements ExpressibleByArgument, CaseIterable and RawRepresentable.
Addresses #637
Checklist
[x] I've added at least one test that validates that my change is working, if appropriate
[x] I've followed the code style of the rest of the project
Previously, information regarding a custom Option type's possible values was lost when generating subsequent structures in the pipeline to describe the argument. This would largely have to be defined by the user in the
discussion
string property inArgumentHelp
and would provide no mechanism to directly access the allowable values for a customOption
.This adds an extra static property on
ExpressibleByArgument
labelleddefaultValueDescriptions
, which maps the value name to its description. It is up to the user to implement thedefaultValueDescription
for their customCaseIterable
type to fully support this behaviour. Further refactoring has been made downstream to the ArgumentDefinition and subsequent structures describing the argument to allow the ability to retrieve the value descriptions from theExpressibleByArgument
type, making information about the property more visible and accessible.A new enumeration
ArgumentDiscussion
has been introduced to better encapsulate the discussion information for an argument, and includes cases for discussion sections that contain only static text, as well as cases that include a list of argument values that derive from a type that implementsExpressibleByArgument
,CaseIterable
andRawRepresentable
.Addresses #637
Checklist