mirror of
https://github.com/go-task/task.git
synced 2024-12-14 10:52:43 +02:00
11 lines
458 B
PowerShell
11 lines
458 B
PowerShell
$scriptBlock = {
|
|
param($commandName, $wordToComplete, $cursorPosition)
|
|
$curReg = "task{.exe}? (.*?)$"
|
|
$startsWith = $wordToComplete | Select-String $curReg -AllMatches | ForEach-Object { $_.Matches.Groups[1].Value }
|
|
$reg = "\* ($startsWith.+?):"
|
|
$listOutput = $(task -l)
|
|
$listOutput | Select-String $reg -AllMatches | ForEach-Object { $_.Matches.Groups[1].Value + " " }
|
|
}
|
|
|
|
Register-ArgumentCompleter -Native -CommandName task -ScriptBlock $scriptBlock
|