1
0
mirror of https://github.com/go-task/task.git synced 2025-03-21 21:27:07 +02:00
task/completion/ps/task.ps1

9 lines
347 B
PowerShell
Raw Normal View History

2020-01-20 11:26:15 +00:00
$scriptBlock = {
2022-10-17 23:52:56 +08:00
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters )
$reg = "\* ($commandName.+?):"
$listOutput = $(task --list-all)
2020-01-20 11:26:15 +00:00
$listOutput | Select-String $reg -AllMatches | ForEach-Object { $_.Matches.Groups[1].Value + " " }
}
2022-10-17 23:52:56 +08:00
Register-ArgumentCompleter -CommandName task -ScriptBlock $scriptBlock