completion: Add bash completion for contexts
This commit is contained in:
committed by
Paul Beckingham
parent
aa8cd54142
commit
3b9d88a87b
@@ -68,7 +68,13 @@ _task_offer_projects() {
|
|||||||
COMPREPLY=( $(compgen -W "$($taskcommand _projects)" -- ${cur/*:/}) )
|
COMPREPLY=( $(compgen -W "$($taskcommand _projects)" -- ${cur/*:/}) )
|
||||||
}
|
}
|
||||||
|
|
||||||
_task()
|
_task_offer_contexts() {
|
||||||
|
COMPREPLY=( $(compgen -W "$($taskcommand _context) define delete list none show" -- $cur) )
|
||||||
|
}
|
||||||
|
|
||||||
|
_task_context_alias=$($taskcommand show | grep alias.*context | cut -d' ' -f1 | cut -d. -f2)
|
||||||
|
|
||||||
|
_task()
|
||||||
{
|
{
|
||||||
local cur prev opts base
|
local cur prev opts base
|
||||||
|
|
||||||
@@ -91,6 +97,10 @@ _task()
|
|||||||
opts="$commands_aliases $($taskcommand _columns)"
|
opts="$commands_aliases $($taskcommand _columns)"
|
||||||
|
|
||||||
case "${prev}" in
|
case "${prev}" in
|
||||||
|
$_task_context_alias|cont|conte|contex|context)
|
||||||
|
_task_offer_contexts
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
:)
|
:)
|
||||||
case "${prev2}" in
|
case "${prev2}" in
|
||||||
pri|prior|priori|priorit|priority)
|
pri|prior|priori|priorit|priority)
|
||||||
|
|||||||
Reference in New Issue
Block a user