mirror of
https://github.com/go-task/task.git
synced 2026-06-11 09:51:50 +00:00
feat(completion): ps completion supports aliases (#2852)
Co-authored-by: Valentin Maerten <maerten.valentin@gmail.com>
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
using namespace System.Management.Automation
|
using namespace System.Management.Automation
|
||||||
|
|
||||||
Register-ArgumentCompleter -CommandName task -ScriptBlock {
|
$cmdNames = @('task') + (Get-Alias -Definition task,task.exe,*\task,*\task.exe -ErrorAction SilentlyContinue).Name | Select-Object -Unique
|
||||||
|
|
||||||
|
Register-ArgumentCompleter -CommandName $cmdNames -ScriptBlock {
|
||||||
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters)
|
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters)
|
||||||
|
|
||||||
if ($commandName.StartsWith('-')) {
|
if ($commandName.StartsWith('-')) {
|
||||||
|
|||||||
Reference in New Issue
Block a user