mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
completion: Add bash completion for contexts
This commit is contained in:
parent
aa8cd54142
commit
3b9d88a87b
1 changed files with 11 additions and 1 deletions
|
@ -68,6 +68,12 @@ _task_offer_projects() {
|
||||||
COMPREPLY=( $(compgen -W "$($taskcommand _projects)" -- ${cur/*:/}) )
|
COMPREPLY=( $(compgen -W "$($taskcommand _projects)" -- ${cur/*:/}) )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_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()
|
_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)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue