mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +00:00
display aliases for long and short args in the cli reference (#12824)
Fixes #12494 (I don't feel like showing it in long-help matters too much...)
This commit is contained in:
parent
039b3c5dda
commit
591bc34d84
2 changed files with 153 additions and 147 deletions
|
@ -232,10 +232,16 @@ fn generate_command<'a>(output: &mut String, command: &'a Command, parents: &mut
|
|||
let id = format!("{name_key}--{long}");
|
||||
|
||||
output.push_str(&format!("<dt id=\"{id}\">"));
|
||||
output.push_str(&format!("<a href=\"#{id}\"><code>--{long}</code></a>",));
|
||||
output.push_str(&format!("<a href=\"#{id}\"><code>--{long}</code></a>"));
|
||||
for long_alias in opt.get_all_aliases().into_iter().flatten() {
|
||||
output.push_str(&format!(", <code>--{long_alias}</code>"));
|
||||
}
|
||||
if let Some(short) = opt.get_short() {
|
||||
output.push_str(&format!(", <code>-{short}</code>"));
|
||||
}
|
||||
for short_alias in opt.get_all_short_aliases().into_iter().flatten() {
|
||||
output.push_str(&format!(", <code>-{short_alias}</code>"));
|
||||
}
|
||||
|
||||
// Re-implements private `Arg::is_takes_value_set` used in `Command::get_opts`
|
||||
if opt
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue