Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion completion/bash/task.bash
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# vim: set tabstop=2 shiftwidth=2 expandtab:

_GO_TASK_COMPLETION_LIST_OPTION='--list-all'
TASK_CMD="${TASK_EXE:-task}"

function _task()
{
Expand Down Expand Up @@ -52,4 +53,4 @@ function _task()
__ltrim_colon_completions "$cur"
}

complete -F _task task
complete -F _task "$TASK_CMD"
2 changes: 1 addition & 1 deletion completion/fish/task.fish
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set -l GO_TASK_PROGNAME task
set -l GO_TASK_PROGNAME (if set -q GO_TASK_PROGNAME; echo $GO_TASK_PROGNAME; else if set -q TASK_EXE; echo $TASK_EXE; else; echo task; end)

function __task_get_tasks --description "Prints all available tasks with their description" --inherit-variable GO_TASK_PROGNAME
# Check if the global task is requested
Expand Down
5 changes: 3 additions & 2 deletions completion/zsh/_task
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#compdef task
compdef _task task
typeset -A opt_args
TASK_CMD="${TASK_EXE:-task}"
compdef _task "$TASK_CMD"

_GO_TASK_COMPLETION_LIST_OPTION="${GO_TASK_COMPLETION_LIST_OPTION:---list-all}"

Expand All @@ -10,7 +11,7 @@ function __task_list() {
local -i enabled=0
local taskfile item task desc

cmd=(task)
cmd=($TASK_CMD)
taskfile=${(Qv)opt_args[(i)-t|--taskfile]}
taskfile=${taskfile//\~/$HOME}

Expand Down
7 changes: 7 additions & 0 deletions website/src/docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,21 +332,28 @@ config:
This method loads the completion script from the currently installed version of
task every time you create a new shell. This ensures that your completions are
always up-to-date.
If your executable isn’t named task, set the `TASK_EXE` environment variable before running eval.

::: code-group

```shell [bash]
# ~/.bashrc

# export TASK_EXE='go-task' if needed
eval "$(task --completion bash)"
```

```shell [zsh]
# ~/.zshrc

# export TASK_EXE='go-task' if needed
eval "$(task --completion zsh)"
```

```shell [fish]
# ~/.config/fish/config.fish

# export TASK_EXE='go-task' if needed
task --completion fish | source
```

Expand Down
Loading