2
# Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3
# Copyright (C) DIGITEO - 2010 - Sylvestre Ledru
4
# This file must be used under the terms of the CeCILL.
5
# This source file is licensed as described in the file COPYING, which
6
# you should have received as part of this distribution. The terms
7
# are also available at
8
# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
12
local cur prev options
14
cur=${COMP_WORDS[COMP_CWORD]}
15
prev=${COMP_WORDS[COMP_CWORD-1]}
17
# List all options. Note that
18
options='-ns -nb -nw -nwni -nogui -debug -debug-kdbg -d -display -profiling -profiling-visu -l -mem -version -e -f -nouserstartup -args -mem -h --help'
20
# Loop on the arguments to manage conflicting options
21
for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do
22
#exclude some mutually exclusive options
23
[[ ${COMP_WORDS[i]} == '-nwni' ]] && options=${options/-nw}
24
[[ ${COMP_WORDS[i]} == '-nw' ]] && options=${options/-nwni}
25
[[ ${COMP_WORDS[i]} == '-e' ]] && options=${options/-f}
30
# Option -nw is not available
31
options=${options/-nw}
37
_filedir '@(sci|sce|SCI|SCE|tst|TST)'
40
-e|-l|-d|-display|-mem)
46
COMPREPLY=( $( compgen -W "$options" | grep "^$cur" ) )
52
complete -F _scilab $filenames scilab scilab-cli scilab-adv-cli