Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _projects() {
- local cur prev opts
- COMPREPLY=()
- cur="${COMP_WORDS[COMP_CWORD]}"
- prev="${COMP_WORDS[COMP_CWORD-1]}"
- opts=$(todolist list by p | cut -d ' ' -f 2 | grep -E "^[^\\[]+$" | sed -e 's/^/+/g')
- if [[ ${cur} == +* ]] ; then
- COMPREPLY=( $(compgen -W "${opts}" + ${cur}) )
- return 0
- fi
- }
- complete -F _projects todolist
Add Comment
Please, Sign In to add comment