File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,8 @@ Register-ArgumentCompleter -Native -CommandName '{bin_name}' -ScriptBlock {{
3737 $element = $commandElements[$i]
3838 if ($element -isnot [StringConstantExpressionAst] -or
3939 $element.StringConstantType -ne [StringConstantType]::BareWord -or
40- $element.Value.StartsWith('-')) {{
40+ $element.Value.StartsWith('-') -or
41+ $element.Value -eq $wordToComplete) {{
4142 break
4243 }}
4344 $element.Value
Original file line number Diff line number Diff line change @@ -52,7 +52,8 @@ Register-ArgumentCompleter -Native -CommandName 'my_app' -ScriptBlock {
5252 $element = $commandElements[$i]
5353 if ($element -isnot [StringConstantExpressionAst] -or
5454 $element.StringConstantType -ne [StringConstantType]::BareWord -or
55- $element.Value.StartsWith('-')) {
55+ $element.Value.StartsWith('-') -or
56+ $element.Value -eq $wordToComplete) {
5657 break
5758 }
5859 $element.Value
@@ -123,7 +124,8 @@ Register-ArgumentCompleter -Native -CommandName 'my_app' -ScriptBlock {
123124 $element = $commandElements[$i]
124125 if ($element -isnot [StringConstantExpressionAst] -or
125126 $element.StringConstantType -ne [StringConstantType]::BareWord -or
126- $element.Value.StartsWith('-')) {
127+ $element.Value.StartsWith('-') -or
128+ $element.Value -eq $wordToComplete) {
127129 break
128130 }
129131 $element.Value
@@ -222,7 +224,8 @@ Register-ArgumentCompleter -Native -CommandName 'cmd' -ScriptBlock {
222224 $element = $commandElements[$i]
223225 if ($element -isnot [StringConstantExpressionAst] -or
224226 $element.StringConstantType -ne [StringConstantType]::BareWord -or
225- $element.Value.StartsWith('-')) {
227+ $element.Value.StartsWith('-') -or
228+ $element.Value -eq $wordToComplete) {
226229 break
227230 }
228231 $element.Value
You can’t perform that action at this time.
0 commit comments