diff --git a/completion/ps/task.ps1 b/completion/ps/task.ps1 index dfee63f5..eba7631c 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 + " " } + $listOutput | Select-String $reg -AllMatches | ForEach-Object { $_.Matches.Groups[1].Value } } -Register-ArgumentCompleter -Native -CommandName task -ScriptBlock $scriptBlock +Register-ArgumentCompleter -CommandName task -ScriptBlock $scriptBlock