Guest User

Untitled

a guest
Oct 23rd, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. function _wpg() {
  2. local optforprofiles
  3. _get_comp_words_by_ref cur
  4. optforprofiles="-s -e -d -z"
  5.  
  6. if [[ $COMP_CWORD = 1 ]]; then
  7. COMPREPLY=($(compgen -W "$(_parse_usage wpg)" -- "$cur"))
  8. elif [[ $COMP_CWORD < 4 || ${COMP_WORDS[1]} != "-s" ]]; then
  9. for opt in $optforprofiles; do
  10. if [[ $opt = ${COMP_WORDS[1]} ]]; then
  11. COMPREPLY=($(compgen -W "$(wpg -l)" -- "$cur"))
  12. fi
  13. done
  14. fi
  15. }
  16.  
  17. complete -F _wpg wpg
Add Comment
Please, Sign In to add comment