Skip to content

Commit 85fa62b

Browse files
committed
Allow : characters in task function names for autocompletion
1 parent 0fd070c commit 85fa62b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

bin/task

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ if [[ -z "$TASKFILE" ]]; then
3030
fi
3131

3232
if [[ $1 == 'comp_targets' ]]; then
33-
awk 'BEGIN {FS = " { [#][#][ ]?"} /^function task:(.*)[#][#][ ]?/ {printf "%s:%s\n", $1, $2}' "$TASKFILE" \
33+
awk 'BEGIN {FS = " { [#][#][ ]?"} /^function task:(.*)[#][#][ ]?/ {gsub(/:/, "\\:", $1); printf "%s:%s\n", $1, $2}' \
34+
"$TASKFILE" \
3435
| sed -E 's/[#]{2,}[ ]*//g' \
35-
| sed -E 's/function task://g'
36+
| sed -E 's/function task\\://g'
3637
exit 1
3738
fi
3839

0 commit comments

Comments
 (0)