mirror of
https://github.com/nushell/nushell.git
synced 2025-05-29 14:21:45 +02:00
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:
parent
a0db4ce747
commit
cf0877bf72
@ -89,12 +89,13 @@ fn get_documentation(
|
|||||||
{
|
{
|
||||||
long_desc.push_str("\nParameters:\n");
|
long_desc.push_str("\nParameters:\n");
|
||||||
for positional in &sig.required_positional {
|
for positional in &sig.required_positional {
|
||||||
long_desc.push_str(&format!(
|
let _ = writeln!(
|
||||||
" (optional) {} <{:?}>: {}\n",
|
long_desc,
|
||||||
|
" {} <{:?}>: {}",
|
||||||
positional.name,
|
positional.name,
|
||||||
document_shape(positional.shape.clone()),
|
document_shape(positional.shape.clone()),
|
||||||
positional.desc
|
positional.desc
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
for positional in &sig.optional_positional {
|
for positional in &sig.optional_positional {
|
||||||
let _ = writeln!(
|
let _ = writeln!(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user