Support for arg-desc element in option maps to complete-getopt #693
If arg-desc is present, it gets added to the completion's display suffix, but outside the parenthesis. I.e.:
produces the following completion items:
I couldn't find any existing tests for complGetopt so I didn't know where to add tests for this - feel free to point me in the right direction.
The text was updated successfully, but these errors were encountered:
If arg-desc is present, it gets added to the completion's display suffix, but outside the parenthesis. I.e.: [&long=select &short=s &arg-desc="<type>" &desc="Select items"] produces the following completion items:
▶(edit:complex-candidate -s &code-suffix='' &display-suffix=' <type> (Select items)' &style='') ▶(edit:complex-candidate --select &code-suffix='' &display-suffix=' <type> (Select items)' &style='')
- extract-opts is now fully configurable both in regex and regex-map - only fields present in regex-map are extracted. - The default regex/regex-map now captures common formats for option arguments and their descriptions, and tries to determine from the format if the argument is mandatory or optional. Based on this, the corresponding arg-mandatory or arg-optional field is set to $true. In any case, if an option argument is detected, arg-desc is set to its captured description (required elves/elvish#693 for proper handling of arg-desc, but will work fine in previous builds, only without displaying arg-desc) - New option &fold (default $false), if $true, preprocess input lines to join descriptions that span to the next line (only joins one additional line at the moment) - Updated documentation and examples.