You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sitegen.completion 313B

1234567891011121314
  1. #!/usr/bin/env bash
  2. _sitegen()
  3. {
  4. cur=${COMP_WORDS[COMP_CWORD]}
  5. if [ $COMP_CWORD -eq 2 ]
  6. then
  7. confs=$(env ls /etc/sitegen/ 2>/dev/null | sed 's/\.[^.]*$//' | sort | uniq | sed 's/^sitegen$//')
  8. COMPREPLY=($(compgen -W "${confs}" "${cur}"))
  9. else
  10. COMPREPLY=()
  11. fi
  12. }
  13. complete -F _sitegen sitegen