1
0
mirror of https://github.com/go-task/task.git synced 2024-12-12 10:45:49 +02:00

Address shellcheck warnings in task.bash

This commit is contained in:
Carl Smedstad 2022-05-22 16:15:15 +02:00
parent 2ad4054133
commit 591561f657
No known key found for this signature in database
GPG Key ID: 5EED78D7F779E010

View File

@ -1,4 +1,4 @@
# /bin/bash
#!/bin/bash
_task_completion()
{
@ -7,12 +7,14 @@ _task_completion()
case "$cur" in
--*)
local options="$(_parse_help task)"
COMPREPLY=( $(compgen -W "$options" -- "$cur") )
local options
options="$(_parse_help task)"
mapfile -t COMPREPLY < <(compgen -W "$options" -- "$cur")
;;
*)
local tasks="$(task --list-all | awk 'NR>1 { sub(/:$/,"",$2); print $2 }')"
COMPREPLY=( $(compgen -W "$tasks" -- "$cur") )
local tasks
tasks="$(task --list-all | awk 'NR>1 { sub(/:$/,"",$2); print $2 }')"
mapfile -t COMPREPLY < <(compgen -W "$tasks" -- "$cur")
;;
esac