/bash_completion_lib/complete/rmmod

http://github.com/brinkman83/bashrc · #! · 18 lines · 12 code · 6 blank · 0 comment · 0 complexity · 76c4f69a62891851e7c388e5d25a0bb9 MD5 · raw file

  1. # Linux rmmod(8) completion. This completes on a list of all currently
  2. # installed kernel modules.
  3. comp_include _get_cword
  4. _rmmod()
  5. {
  6. local cur
  7. COMPREPLY=()
  8. cur=`_get_cword`
  9. COMPREPLY=( $( /sbin/lsmod | \
  10. awk '{if (NR != 1 && $1 ~ /^'$cur'/) print $1}' 2>/dev/null ))
  11. return 0
  12. } # _rmmod()