aboutsummaryrefslogtreecommitdiff
path: root/mingling_core/tmpls/comps/pwsl.ps1
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-04-12 03:55:38 +0800
committer魏曹先生 <1992414357@qq.com>2026-04-12 03:55:38 +0800
commit643b5ccb1c27e76a03e85dc6fb9137c020dcae01 (patch)
tree47a34c33f55c4d426f77ced2fe3595c64ade2765 /mingling_core/tmpls/comps/pwsl.ps1
parent2d2ba53b0deed00e5c41529b6362a8da65347550 (diff)
Fix typo in PowerShell shell flag from "pwsl" to "pwsh"HEADmain
Diffstat (limited to 'mingling_core/tmpls/comps/pwsl.ps1')
-rw-r--r--mingling_core/tmpls/comps/pwsl.ps143
1 files changed, 0 insertions, 43 deletions
diff --git a/mingling_core/tmpls/comps/pwsl.ps1 b/mingling_core/tmpls/comps/pwsl.ps1
deleted file mode 100644
index 6d7d91d..0000000
--- a/mingling_core/tmpls/comps/pwsl.ps1
+++ /dev/null
@@ -1,43 +0,0 @@
-Register-ArgumentCompleter -CommandName <<<bin_name>>> -ScriptBlock {
- param($wordToComplete, $commandAst, $cursorPosition)
-
- $line = $commandAst.ToString()
- $commandName = if ($commandAst.CommandElements.Count -gt 0) {
- $commandAst.CommandElements[0].Value
- } else { "" }
-
- $words = @()
- $currentIndex = 0
- $parser = [System.Management.Automation.PSParser]
- $tokens = $parser::Tokenize($line, [ref]$null)
-
- foreach ($token in $tokens) {
- if ($token.Type -in 'CommandArgument', 'CommandParameter') {
- $words += $token.Content
- }
- }
-
- $args = @(
- "-f", ($line -replace '-', '^')
- "-C", $cursorPosition.ToString()
- "-w", ($wordToComplete -replace '-', '^')
- "-p", (if ($words.Count -gt 1) { $words[-2] } else { "" }) -replace '-', '^'
- "-c", $commandName
- "-i", ($words.Count - 1).ToString()
- "-a", ($words | ForEach-Object { $_ -replace '-', '^' })
- "-F", "powershell"
- )
-
- $suggestions = <<<bin_name>>> __comp $args 2>$null
-
- if ($suggestions) {
- $suggestions | ForEach-Object {
- if ($_ -eq "_file_") {
- $completionType = 'ProviderItem'
- } else {
- $completionType = 'ParameterValue'
- }
- [System.Management.Automation.CompletionResult]::new($_, $_, $completionType, $_)
- }
- }
-}