First attempt at #113: Support help strings for CLI arguments #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@IamCathal and I are seeking feedback on the code we wrote to get a description of the arguments (original issue: [FEATURE] Support help strings for CLI arguments). This is how we thought about implementing it:
help
parameter toArgument
,ArgumentInfo
, andParameterInfo
classesget_arguments_description_from_info
function that given an instance ofCommandInfo
returns an array of descriptions for theArgumentInfo
objects. Each description has thename
and thehelp
attributes (how do we get the type out of anannotation
object)?Would this be the right way ahead, or should we look into implementing it using something different? Eventually, we would create a string out of the
args_descriptions
list and pass it tocommand.cls(..., help=our_string_here)
. We also noticed the text that goes intohelp
does get some formatting (leading spaces).This is obviously not meant to be merged - just looking for initial feedback on code styling ad logic (any feedback is welcome).