mirror of
https://github.com/sharkdp/bat.git
synced 2026-10-30 10:06:12 +00:00
Update PowerShell completions for compatibility with PowerShell v5.1
Modified the PowerShell completion script to replace the null-coalescing operator (`??` - a v7 feature) with a conditional statement compatible with PowerShell v5.1. The script now uses an if-else check for null descriptions in the language completion section.
This commit is contained in:
1 parent
c88353b386
commit
af8f0626ac
1 file changed
+4
-1
Vendored
+4
-1
@@ -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' {
|
||||||
|
|||||||
Reference in new issue
Block a user