modified _filedir() and _longopt() to allow mkdir and rmdir to complete only
on directories
This commit is contained in:
parent
aa73cdba0c
commit
f99b5193cd
@ -1,6 +1,6 @@
|
|||||||
# bash_completion - some programmable completion functions for bash 2.05a
|
# bash_completion - some programmable completion functions for bash 2.05a
|
||||||
#
|
#
|
||||||
# $Id: bash_completion,v 1.141 2002/02/22 08:41:05 ianmacd Exp $
|
# $Id: bash_completion,v 1.142 2002/02/22 16:48:21 ianmacd Exp $
|
||||||
#
|
#
|
||||||
# Copyright (C) Ian Macdonald <ian@caliban.org>
|
# Copyright (C) Ian Macdonald <ian@caliban.org>
|
||||||
#
|
#
|
||||||
@ -1763,6 +1763,8 @@ _longopt()
|
|||||||
COMPREPLY=( $( $1 --help | sed -e '/--/!d' \
|
COMPREPLY=( $( $1 --help | sed -e '/--/!d' \
|
||||||
-e 's/.*\(--[-A-Za-z0-9]\+=\?\).*/\1/' | \
|
-e 's/.*\(--[-A-Za-z0-9]\+=\?\).*/\1/' | \
|
||||||
grep ^$cur | sort -u ) )
|
grep ^$cur | sort -u ) )
|
||||||
|
elif [[ "$1" = @(mk|rm)dir ]]; then
|
||||||
|
_filedir -d
|
||||||
else
|
else
|
||||||
_filedir
|
_filedir
|
||||||
fi
|
fi
|
||||||
@ -1924,8 +1926,11 @@ _filedir()
|
|||||||
|
|
||||||
_expand || return 0
|
_expand || return 0
|
||||||
|
|
||||||
COMPREPLY=( ${COMPREPLY[@]} $( eval compgen -f \"$cur\" ) \
|
if [ "$1" = -d ]; then
|
||||||
$( compgen -d $cur ) )
|
COMPREPLY=( ${COMPREPLY[@]} $( compgen -d $cur ) )
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
COMPREPLY=( ${COMPREPLY[@]} $( eval compgen -f \"$cur\" ) )
|
||||||
}
|
}
|
||||||
|
|
||||||
_filedir_xspec()
|
_filedir_xspec()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user