~ubuntu-branches/ubuntu/lucid/bash-completion/lucid

« back to all changes in this revision

Viewing changes to bash_completion

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2009-01-21 18:33:06 UTC
  • Revision ID: james.westby@ubuntu.com-20090121183306-phqc6i5gd6akzwu5
Tags: 20080705ubuntu2
modprobe: Check for */* before checking for 'modprobe -r', to avoid
spewing an awk syntax error (thanks, Martin Mai; LP: #316654).

Show diffs side-by-side

added added

removed removed

Lines of Context:
794
794
        cur=`_get_cword`
795
795
        prev=${COMP_WORDS[COMP_CWORD-1]}
796
796
 
 
797
        # do filename completion if we're giving a path to a module
 
798
        if [[ "$cur" == */* ]]; then
 
799
                _filedir '@(?(k)o?(.gz))'
 
800
                return 0
 
801
        fi
 
802
 
797
803
        # behave like lsmod for modprobe -r
798
804
        if [ $1 = "modprobe" ] &&
799
805
           [ "${COMP_WORDS[1]}" = "-r" ]; then
802
808
                return 0
803
809
        fi
804
810
 
805
 
        # do filename completion if we're giving a path to a module
806
 
        if [[ "$cur" == */* ]]; then
807
 
                _filedir '@(?(k)o?(.gz))'
808
 
                return 0
809
 
        fi
810
 
 
811
811
        if [ $COMP_CWORD -gt 1 ] &&
812
812
           [[ "${COMP_WORDS[COMP_CWORD-1]}" != -* ]]; then
813
813
                # do module parameter completion