on master help sign in
Merge pull request #354 from yfyf/add_bash_completion

Add bash completion file for Idris

commitb467eeada1762517194ddff33b091c9c9c0e079e authorEdwin Brady <edwin.brady@gmail.com> dateFri 28 Jun 2013, 07:15 (13 years ago) parent031ffb431f4e9f
1 file changed+31
contribs/tool-support/completion/idris.bash+31
contribs/tool-support/completion/idris.bashnew file+31
@@ -0,0 +1,31 @@
1+_idris() {
2+ local cur prev words opts LIBRARIES TARGETS
3+ _init_completion || return
4+
5+ opts=$(_parse_help "$1")
6+ LIBRARIES="effects"
7+ TARGETS="C Java bytecode javascript node"
8+
9+ case "${prev}" in
10+ -o)
11+ _filedir
12+ ;;
13+ -i|--ibcsubdir)
14+ _filedir -d
15+ ;;
16+ -p)
17+ COMPREPLY=( $(compgen -W "${LIBRARIES}" -- ${cur}))
18+ ;;
19+ --target)
20+ COMPREPLY=( $(compgen -W "${TARGETS}" -- ${cur}))
21+ ;;
22+ esac
23+
24+ if [[ $cur == -* ]]; then
25+ COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
26+ return
27+ fi
28+
29+ _filedir '@(idr)'
30+} &&
31+complete -o default -F _idris idris