From 394afe26334f08ae89b7f19417844ce87a0d6604 Mon Sep 17 00:00:00 2001 From: Trim21 Date: Mon, 17 Oct 2022 23:52:56 +0800 Subject: [PATCH 1/2] Update task.ps1 --- completion/ps/task.ps1 | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/completion/ps/task.ps1 b/completion/ps/task.ps1 index dfee63f5..08ef6c58 100644 --- a/completion/ps/task.ps1 +++ b/completion/ps/task.ps1 @@ -1,10 +1,8 @@ $scriptBlock = { - param($commandName, $wordToComplete, $cursorPosition) - $curReg = "task{.exe}? (.*?)$" - $startsWith = $wordToComplete | Select-String $curReg -AllMatches | ForEach-Object { $_.Matches.Groups[1].Value } - $reg = "\* ($startsWith.+?):" + param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters ) + $reg = "\* ($commandName.+?):" $listOutput = $(task --list-all) $listOutput | Select-String $reg -AllMatches | ForEach-Object { $_.Matches.Groups[1].Value + " " } } -Register-ArgumentCompleter -Native -CommandName task -ScriptBlock $scriptBlock +Register-ArgumentCompleter -CommandName task -ScriptBlock $scriptBlock From 2e573d37aee2d677eb398a9686f3df1bee79f473 Mon Sep 17 00:00:00 2001 From: Trim21 Date: Tue, 18 Oct 2022 00:09:07 +0800 Subject: [PATCH 2/2] Update task.ps1 --- completion/ps/task.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completion/ps/task.ps1 b/completion/ps/task.ps1 index 08ef6c58..eba7631c 100644 --- a/completion/ps/task.ps1 +++ b/completion/ps/task.ps1 @@ -2,7 +2,7 @@ $scriptBlock = { param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters ) $reg = "\* ($commandName.+?):" $listOutput = $(task --list-all) - $listOutput | Select-String $reg -AllMatches | ForEach-Object { $_.Matches.Groups[1].Value + " " } + $listOutput | Select-String $reg -AllMatches | ForEach-Object { $_.Matches.Groups[1].Value } } Register-ArgumentCompleter -CommandName task -ScriptBlock $scriptBlock