ensure required positionals don't show up as optional when help (#5916)

* ensure `required` positionals show up as `required` when `help`

* moves it to the older format

* standardises across optional and required parameters
This commit is contained in:
pwygab 2022-07-01 01:51:41 +08:00 committed by GitHub
parent a0db4ce747
commit cf0877bf72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -89,12 +89,13 @@ fn get_documentation(
{
long_desc.push_str("\nParameters:\n");
for positional in &sig.required_positional {
long_desc.push_str(&format!(
" (optional) {} <{:?}>: {}\n",
let _ = writeln!(
long_desc,
" {} <{:?}>: {}",
positional.name,
document_shape(positional.shape.clone()),
positional.desc
));
);
}
for positional in &sig.optional_positional {
let _ = writeln!(