mirror of
https://github.com/nikolassv/bartib
synced 2024-12-03 16:59:12 +00:00
18 lines
368 B
Bash
18 lines
368 B
Bash
#!/bin/bash
|
|
|
|
_bartib_completions()
|
|
{
|
|
local CWORD=${COMP_WORDS[COMP_CWORD]}
|
|
ALL_PROJECTS=`bartib projects`
|
|
|
|
local IFS=$'\n'
|
|
CANDIATE_PROJECTS=($(compgen -W "${ALL_PROJECTS[*]}" -- "$CWORD"))
|
|
|
|
if [ ${#CANDIATE_PROJECTS[*]} -eq 0 ]; then
|
|
COMPREPLY=()
|
|
else
|
|
COMPREPLY=($(printf "\"%s\"\n" "${CANDIATE_PROJECTS[@]}"))
|
|
fi
|
|
}
|
|
|
|
complete -F _bartib_completions bartib
|