clap_generate PowerShell script does not complete case sensitive options like -S. Only completes -s #2145
Closed
2 tasks done
Labels
A-completion
Area: completion generator
C-bug
Category: Updating dependencies
E-medium
Call for participation: Experience needed to fix: Medium / intermediate
💸 $5
Make sure you completed the following tasks
Code
https://github.com/clap-rs/clap/blob/3e9ee86713b5c407b50ba76f30cffaed25952063/clap_generate/src/generators/shells/powershell.rs
Steps to reproduce the issue
N/A
Version
name = "clap"
version = "2.33.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bdfa80d47f954d53a35a64987ca1422f495b8d6483c0fe9f7117b36c2a792129"
dependencies = [
"bitflags",
"strsim",
"textwrap",
"unicode-width",
]
Actual Behavior Summary
https://github.com/BurntSushi/ripgrep generated _rg.ps1 does not complete -S correctly. It only completes -s.
Expected Behavior Summary
See BurntSushi/ripgrep#1690 for details.
. _rg.ps1
rg -s<Ctrl-Space>
completesrg -s
. It should produce:A simple fix would be to change ListItemText for 'S' to 'S '. The space makes ListItemText unique, which is all that's needed.
Additional context
A simple fix may be to test for upper case and append a space. I don't know rust, so a PR is beyond me.
clap/clap_generate/src/generators/shells/powershell.rs
Line 94 in 3e9ee86
clap/clap_generate/src/generators/shells/powershell.rs
Line 105 in 3e9ee86
For example, change the second '{}' to '{} ' in the format! below after adding a check for upper case. Sorry I can't be more helpful.
Debug output
N/A
The text was updated successfully, but these errors were encountered: