mirror of
https://github.com/go-task/task.git
synced 2025-01-12 04:34:11 +02:00
Update task.ps1
This commit is contained in:
parent
33b6927b79
commit
394afe2633
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user