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:
parent
ed9f33586e
commit
969832b157
1 changed files with 10 additions and 8 deletions
|
@ -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(){
|
||||
|
|
Loading…
Reference in a new issue