1
0
mirror of https://github.com/sharkdp/bat.git synced 2026-02-08 00:32:08 +00:00

Merge pull request #3495 from sharkdp/powershell_completions

Update PowerShell completions for compatibility with PowerShell v5.1
This commit is contained in:
Keith Hall
2025-11-28 22:49:44 +02:00
committed by GitHub
2 changed files with 5 additions and 2 deletions

View File

@@ -12,7 +12,7 @@
## Other ## Other
- Improve README documentation on pager options passed to less, see #3443 (@injust) - Improve README documentation on pager options passed to less, see #3443 (@injust)
- Make PowerShell completions compatible with PowerShell v5.1, see #3495 (@keith-hall)
- Use more robust approach to escaping in Bash completions, see #3448 (@akinomyoga) - Use more robust approach to escaping in Bash completions, see #3448 (@akinomyoga)
## Syntaxes ## Syntaxes

View File

@@ -49,7 +49,10 @@ Register-ArgumentCompleter -Native -CommandName '{{PROJECT_EXECUTABLE}}' -Script
} }
'*;--language' { '*;--language' {
Get-MyLanguages | Get-MyLanguages |
ForEach-Object {[CompletionResult]::new(($_.MyParameter -replace "^(.*)$", '''$1'''), $_.MyParameter, [CompletionResultType]::ParameterName, $_.MyDescription ?? '_no value_')} ForEach-Object {
$desc = if ($null -eq $_.MyDescription) { '_no value_' } else { $_.MyDescription }
[CompletionResult]::new(($_.MyParameter -replace "^(.*)$", '''$1'''), $_.MyParameter, [CompletionResultType]::ParameterName, $desc)
}
break break
} }
'*;--theme' { '*;--theme' {