[bash_completion] Get rid of contain function
This commit is contained in:
parent
dae7b30c7e
commit
53324fa30e
1 changed files with 2 additions and 13 deletions
|
@ -1,16 +1,5 @@
|
||||||
# Fonction de notre auto completion
|
# Fonction de notre auto completion
|
||||||
|
|
||||||
contain(){
|
|
||||||
local i
|
|
||||||
for i in $2; do
|
|
||||||
if [[ "$i" = "$1" ]]; then
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if [[ "$EDITOR" = "" ]]; then
|
if [[ "$EDITOR" = "" ]]; then
|
||||||
export EDITOR="nano";
|
export EDITOR="nano";
|
||||||
fi
|
fi
|
||||||
|
@ -46,7 +35,7 @@ _cranspasswords(){
|
||||||
find "$pass_dir" -type f -mmin +$timeout -exec rm -f {} \;
|
find "$pass_dir" -type f -mmin +$timeout -exec rm -f {} \;
|
||||||
|
|
||||||
# On détermine si on utilsie un serveur alternatif
|
# On détermine si on utilsie un serveur alternatif
|
||||||
if contain "--server" "${COMP_WORDS[*]}"; then
|
if [[ "${COMP_WORDS[*]}" = *" --server "* ]]; then
|
||||||
if [[ "$prev" = "--server" ]]; then
|
if [[ "$prev" = "--server" ]]; then
|
||||||
_cranspasswords_server=$last;
|
_cranspasswords_server=$last;
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue