~ubuntu-branches/ubuntu/lucid/scilab/lucid

« back to all changes in this revision

Viewing changes to debian/bash_completion.d/scilab

  • Committer: Bazaar Package Importer
  • Author(s): Sylvestre Ledru
  • Date: 2010-04-03 22:12:44 UTC
  • mfrom: (4.3.15 sid)
  • Revision ID: james.westby@ubuntu.com-20100403221244-0x5827lijgkiobuh
Tags: 5.2.1-8
* Enable also the keep alive for Debian (sparc has some pbs on the 
 documentation build)
* Update of the completion script
* Update of the README.Debian file (Scilab is free since 5.0.0)
* Fix a problem with the unitary tests (permission). Backport from upstream.
  test_run_permission.diff
* In case of error on the library load, provide more feedbacks 
  better-feedback-on-lib-error.diff

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Scilab completion
 
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
 
9
 
 
10
_scilab()
 
11
{
 
12
    local cur prev options
 
13
    COMPREPLY=()
 
14
    cur=${COMP_WORDS[COMP_CWORD]}
 
15
    prev=${COMP_WORDS[COMP_CWORD-1]}
 
16
 
 
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'
 
19
 
 
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}
 
26
    done
 
27
    
 
28
    case "$1" in
 
29
         *scilab-cli*)
 
30
                # Option -nw is not available
 
31
                options=${options/-nw}
 
32
        ;;
 
33
    esac
 
34
 
 
35
    case $prev in
 
36
        -f)
 
37
                _filedir '@(sci|sce|SCI|SCE|tst|TST)'
 
38
                return 0
 
39
            ;;
 
40
        -e|-l|-d|-display|-mem)
 
41
                cur=${cur#[\"\']}
 
42
                eqext='='
 
43
            ;;
 
44
        
 
45
        *)
 
46
            COMPREPLY=( $( compgen -W "$options" | grep "^$cur" ) )
 
47
            ;;
 
48
    esac
 
49
 
 
50
    return 0
 
51
}
 
52
complete -F _scilab $filenames scilab scilab-cli scilab-adv-cli
 
53
 
 
54