diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-03-15 01:12:06 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-03-15 01:12:06 +0800 |
| commit | 10ed02b8541a80e60f7ad9f9fb51f8070d6be525 (patch) | |
| tree | bfc034d1ad0c2d5567a53ece074932040dfb8d43 /scripts/deploy/completions/powershell.ps1 | |
| parent | 72f80ea51f25256d0c463c2f3dc3d8670cfc4634 (diff) | |
Add completions system for shell autocompletion
Diffstat (limited to 'scripts/deploy/completions/powershell.ps1')
| -rw-r--r-- | scripts/deploy/completions/powershell.ps1 | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/deploy/completions/powershell.ps1 b/scripts/deploy/completions/powershell.ps1 index 0c3cddc..ec91038 100644 --- a/scripts/deploy/completions/powershell.ps1 +++ b/scripts/deploy/completions/powershell.ps1 @@ -18,13 +18,13 @@ Register-ArgumentCompleter -CommandName jvn -ScriptBlock { } $args = @( - "-f", $line + "-f", ($line -replace '-', '^') "-C", $cursorPosition.ToString() - "-w", $wordToComplete - "-p", if ($words.Count -gt 1) { $words[-2] } else { "" } + "-w", ($wordToComplete -replace '-', '^') + "-p", (if ($words.Count -gt 1) { $words[-2] } else { "" }) -replace '-', '^' "-c", $commandName "-i", ($words.Count - 1).ToString() - "-a", $words + "-a", ($words | ForEach-Object { $_ -replace '-', '^' }) ) $suggestions = jvn_comp $args 2>$null |
