mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 22:50:14 +02:00
document out positional argument type (#5461)
This commit is contained in:
@ -87,19 +87,22 @@ fn get_documentation(
|
||||
{
|
||||
long_desc.push_str("\nParameters:\n");
|
||||
for positional in &sig.required_positional {
|
||||
long_desc.push_str(&format!(" {}: {}\n", positional.name, positional.desc));
|
||||
long_desc.push_str(&format!(
|
||||
" {} <{:?}>: {}\n",
|
||||
positional.name, positional.shape, positional.desc
|
||||
));
|
||||
}
|
||||
for positional in &sig.optional_positional {
|
||||
long_desc.push_str(&format!(
|
||||
" (optional) {}: {}\n",
|
||||
positional.name, positional.desc
|
||||
" (optional) {} <{:?}>: {}\n",
|
||||
positional.name, positional.shape, positional.desc
|
||||
));
|
||||
}
|
||||
|
||||
if let Some(rest_positional) = &sig.rest_positional {
|
||||
long_desc.push_str(&format!(
|
||||
" ...{}: {}\n",
|
||||
rest_positional.name, rest_positional.desc
|
||||
" ...{} <{:?}>: {}\n",
|
||||
rest_positional.name, rest_positional.shape, rest_positional.desc
|
||||
));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user