mirror of
https://github.com/go-task/task.git
synced 2024-12-04 10:24:45 +02:00
fix(completions): zsh and powershell completions (#1809)
This commit is contained in:
parent
5aa68e47e5
commit
84cc5e57b0
@ -1,6 +1,5 @@
|
||||
#compdef task
|
||||
|
||||
local context state state_descr line
|
||||
compdef _task task
|
||||
typeset -A opt_args
|
||||
|
||||
_GO_TASK_COMPLETION_LIST_OPTION="${GO_TASK_COMPLETION_LIST_OPTION:---list-all}"
|
||||
@ -39,6 +38,7 @@ function __task_list() {
|
||||
_describe 'Task to run' scripts
|
||||
}
|
||||
|
||||
_task() {
|
||||
_arguments \
|
||||
'(-C --concurrency)'{-C,--concurrency}'[limit number of concurrent tasks]: ' \
|
||||
'(-p --parallel)'{-p,--parallel}'[run command-line tasks in parallel]' \
|
||||
@ -62,3 +62,9 @@ _arguments \
|
||||
'(-*)'{-h,--help}'[show help]' \
|
||||
'(-*)--version[show version and exit]' \
|
||||
'*: :__task_list'
|
||||
}
|
||||
|
||||
# don't run the completion function when being source-ed or eval-ed
|
||||
if [ "$funcstack[1]" = "_task" ]; then
|
||||
_task "$@"
|
||||
fi
|
||||
|
@ -287,7 +287,7 @@ task --completion fish | source
|
||||
|
||||
<TabItem value="4">
|
||||
```powershell title="$PROFILE\Microsoft.PowerShell_profile.ps1"
|
||||
Invoke-Expression (&task --completion powershell)
|
||||
Invoke-Expression (&task --completion powershell | Out-String)
|
||||
```
|
||||
</TabItem></Tabs>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user