File tree 1 file changed +19
-2
lines changed
1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change 1
- set GO_TASK_PROGNAME task
1
+ set -l GO_TASK_PROGNAME task
2
2
3
3
function __task_get_tasks --description " Prints all available tasks with their description" --inherit-variable GO_TASK_PROGNAME
4
+ # Check if the global task is requested
5
+ set -l global_task false
6
+ commandline --current-process | read --tokenize --list --local cmd_args
7
+ for arg in $cmd_args
8
+ if test " _$arg " = " _--"
9
+ break # ignore arguments to be passed to the task
10
+ end
11
+ if test " _$arg " = " _--global" -o " _$arg " = " _-g"
12
+ set global_task true
13
+ break
14
+ end
15
+ end
16
+
4
17
# Read the list of tasks (and potential errors)
5
- $GO_TASK_PROGNAME --list-all 2>&1 | read -lz rawOutput
18
+ if $global_task
19
+ $GO_TASK_PROGNAME --global --list-all
20
+ else
21
+ $GO_TASK_PROGNAME --list-all
22
+ end 2>&1 | read -lz rawOutput
6
23
7
24
# Return on non-zero exit code (for cases when there is no Taskfile found or etc.)
8
25
if test $status -ne 0
You can’t perform that action at this time.
0 commit comments