File: scilab

package info (click to toggle)
scilab 6.1.1%2Bdfsg2-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 374,776 kB
  • sloc: xml: 815,051; cpp: 281,051; ansic: 223,156; java: 172,167; fortran: 91,481; ml: 23,103; tcl: 16,853; sh: 10,859; makefile: 9,647; lex: 1,611; perl: 1,566; yacc: 1,264; php: 690; cs: 614; javascript: 50
file content (54 lines) | stat: -rw-r--r-- 1,578 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Scilab completion
# Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
# Copyright (C) DIGITEO - 2010 - Sylvestre Ledru
# This file must be used under the terms of the CeCILL.
# This source file is licensed as described in the file COPYING, which
# you should have received as part of this distribution.  The terms
# are also available at    
# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt

_scilab()
{
    local cur prev options
    COMPREPLY=()
    cur=${COMP_WORDS[COMP_CWORD]}
    prev=${COMP_WORDS[COMP_CWORD-1]}

    # List all options. Note that 
    options='-ns -nb -nw -nwni -nogui -debug -debug-kdbg -d -display -profiling -profiling-visu -l -mem -version -e -f -nouserstartup -args -mem -h --help'

    # Loop on the arguments to manage conflicting options
    for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do
	#exclude some mutually exclusive options
	[[ ${COMP_WORDS[i]} == '-nwni' ]] && options=${options/-nw}
        [[ ${COMP_WORDS[i]} == '-nw' ]] && options=${options/-nwni}
        [[ ${COMP_WORDS[i]} == '-e' ]] && options=${options/-f}
    done
    
    case "$1" in
    	 *scilab-cli*)
		# Option -nw is not available
            	options=${options/-nw}
	;;
    esac

    case $prev in
        -f)
		_filedir '@(sci|sce|SCI|SCE|tst|TST)'
		return 0
            ;;
        -e|-l|-d|-display|-mem)
		cur=${cur#[\"\']}
		eqext='='
            ;;
	
        *)
            COMPREPLY=( $( compgen -W "$options" | grep "^$cur" ) )
            ;;
    esac

    return 0
}
complete -F _scilab $filenames scilab scilab-cli scilab-adv-cli