Skip to content

Commit

Permalink
fix(clap_complete): Add missing option hyphens to the listItemText pa…
Browse files Browse the repository at this point in the history
…rameter in PowerShell completions
  • Loading branch information
Mixu78 committed Jul 31, 2024
1 parent 1c64d99 commit 25fdf80
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clap_complete/src/shells/powershell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ fn generate_aliases(completions: &mut String, preamble: &String, arg: &Arg) {
for alias in aliases {
let _ = write!(
completions,
"{preamble}'-{alias}', '{alias}{}', [CompletionResultType]::ParameterName, '{tooltip}')",
"{preamble}'-{alias}', '-{alias}{}', [CompletionResultType]::ParameterName, '{tooltip}')",
// make PowerShell realize there is a difference between `-s` and `-S`
if alias.is_uppercase() { " " } else { "" },
);
Expand All @@ -142,7 +142,7 @@ fn generate_aliases(completions: &mut String, preamble: &String, arg: &Arg) {
for alias in aliases {
let _ = write!(
completions,
"{preamble}'--{alias}', '{alias}', [CompletionResultType]::ParameterName, '{tooltip}')"
"{preamble}'--{alias}', '--{alias}', [CompletionResultType]::ParameterName, '{tooltip}')"
);
}
}
Expand Down

0 comments on commit 25fdf80

Please sign in to comment.