Guest User

Untitled

a guest
Dec 16th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. _projects() {
  2. local cur prev opts
  3. COMPREPLY=()
  4. cur="${COMP_WORDS[COMP_CWORD]}"
  5. prev="${COMP_WORDS[COMP_CWORD-1]}"
  6. opts=$(todolist list by p | cut -d ' ' -f 2 | grep -E "^[^\\[]+$" | sed -e 's/^/+/g')
  7. if [[ ${cur} == +* ]] ; then
  8. COMPREPLY=( $(compgen -W "${opts}" + ${cur}) )
  9. return 0
  10. fi
  11. }
  12.  
  13. complete -F _projects todolist
Add Comment
Please, Sign In to add comment