forked from sawadashota/go-task-completions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_task
29 lines (25 loc) · 1.3 KB
/
_task
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#compdef task
# Listing commands from Taskfile.yml
function __list() {
local -a scripts
if [ -f Taskfile.yml ]; then
scripts=($(task -l | sed '1d' | sed 's/://' | awk '{ print $2 }'))
_describe 'script' scripts
fi
}
_arguments \
'(-d --dir)'{-d,--dir}'[sets directory of execution]: :_files' \
'(--dry)'--dry'[compiles and prints tasks in the order that they would be run, without executing them]' \
'(-f --force)'{-f,--force}'[forces execution even when the task is up-to-date]' \
'(-i --init)'{-i,--init}'[creates a new Taskfile.yml in the current folder]' \
'(-l --list)'{-l,--list}'[lists tasks with description of current Taskfile]' \
'(-p --parallel)'{-p,--parallel}'[executes tasks provided on command line in parallel]' \
'(-s --silent)'{-s,--silent}'[disables echoing]' \
'(--status)'--status'[exits with non-zero exit code if any of the given tasks is not up-to-date]' \
'(--summary)'--summary'[show summary about a task]' \
'(-t --taskfile)'{-t,--taskfile}'[choose which Taskfile to run. Defaults to "Taskfile.yml"]' \
'(-v --verbose)'{-v,--verbose}'[enables verbose mode]' \
'(--version)'--version'[show Task version]' \
'(-w --watch)'{-w,--watch}'[enables watch of the given task]' \
'(- *)'{-h,--help}'[show help]' \
'*: :__list'