mirror of
https://github.com/go-task/task.git
synced 2025-03-17 21:08:01 +02:00
Add PowerShell completion script
This commit is contained in:
parent
de98a53b43
commit
68ecb7fbdd
10
completion/ps/task.ps1
Normal file
10
completion/ps/task.ps1
Normal file
@ -0,0 +1,10 @@
|
||||
$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
|
Loading…
x
Reference in New Issue
Block a user