mirror of
https://github.com/clap-rs/clap
synced 2025-03-04 15:27:16 +00:00
Auto merge of #905 - peppsac:fish_subcommand_help, r=kbknapp
imp: add fish subcommand help support Adds the `-d help_string` parameter to fish completion is present. Example output: ``` complete -c mm3d -n "__fish_using_command mm3d" -f -a "Ann" -d "matches points [...]" ``` <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/kbknapp/clap-rs/905) <!-- Reviewable:end -->
This commit is contained in:
commit
8edb1f9808
2 changed files with 568 additions and 565 deletions
|
@ -95,6 +95,9 @@ fn gen_fish_inner(root_command: &str, comp_gen: &FishGen, parent_cmds: &str, buf
|
|||
let mut template = basic_template.clone();
|
||||
template.push_str(" -f");
|
||||
template.push_str(format!(" -a \"{}\"", &subcommand.p.meta.name).as_str());
|
||||
if let Some(data) = subcommand.p.meta.about {
|
||||
template.push_str(format!(" -d \"{}\"", &data).as_str())
|
||||
}
|
||||
buffer.push_str(template.as_str());
|
||||
buffer.push_str("\n");
|
||||
}
|
||||
|
|
1130
tests/completions.rs
1130
tests/completions.rs
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue