1
0
Fork 0
mirror of https://github.com/hcartiaux/dotfiles.git synced 2024-10-18 09:15:24 +02:00

[bash] oarsh completion, test if the SHELL is bash

This commit is contained in:
Hyacinthe Cartiaux 2014-02-14 03:11:42 +01:00
parent ed9f33586e
commit 969832b157

View file

@ -9,14 +9,16 @@
# - http://wiki-oar.imag.fr/index.php/Customization_tips
# - http://wiki-oar.imag.fr/index.php/Oarsh_and_bash_completion
# oarsh completion
function _oarsh_complete_()
{
local word=${COMP_WORDS[COMP_CWORD]}
local list=`cat $OAR_NODEFILE | uniq | tr '\n' ' '`
COMPREPLY=($(compgen -W "$list" -- "${word}"))
}
complete -F _oarsh_complete_ oarsh
if [[ '$SHELL' = '/bin/bash' ]] ; then
# oarsh completion
function _oarsh_complete_()
{
local word=${COMP_WORDS[COMP_CWORD]}
local list=`cat $OAR_NODEFILE | uniq | tr '\n' ' '`
COMPREPLY=($(compgen -W "$list" -- "${word}"))
}
complete -F _oarsh_complete_ oarsh
fi
# Job + Remaining time
__oar_ps1_remaining_time(){