Advertisement
Guest User

Untitled

a guest
Aug 26th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. https://gist.github.com/caseyfw/51bdbcb37e5dfb91b74e
  2.  
  3. #!/bin/sh
  4. function __robo_list_cmds ()
  5. {
  6. robo list --raw | awk '{print $1}' | sort
  7. }
  8.  
  9. function __robo_list_opts ()
  10. {
  11. robo list --no-ansi | sed -e '1,/Options:/d' -e '/^$/,$d' -e 's/^ *//' -e 's/ .*//' | sort
  12. }
  13.  
  14. _robo()
  15. {
  16. local cur="${COMP_WORDS[COMP_CWORD]}"
  17. COMPREPLY=($(compgen -W "$(__robo_list_opts) $(__robo_list_cmds)" -- ${cur}))
  18. return 0;
  19. }
  20.  
  21. complete -o default -F _robo robo
  22. COMP_WORDBREAKS=${COMP_WORDBREAKS//:}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement