-
Notifications
You must be signed in to change notification settings - Fork 4
/
.circ
42 lines (37 loc) · 1.14 KB
/
.circ
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
# add project folder to PATH
projectDir=$(dirname $(realpath $_))
export PATH=${projectDir}:$PATH
NXF_OPTIONS=$(nextflow help run | egrep -o '\-\w+\.?' | sort -u)
PIPE_OPTIONS=$(egrep log chipseq-pipeline.nf | egrep -o '\-{2}[^ ]+ ')
_ci() {
local cur prev
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
case ${COMP_CWORD} in
1)
COMPREPLY=($(compgen -W "run validate cleanup" ${cur}))
;;
[2-9]|[1-9][0-9])
case ${COMP_WORDS[1]} in
run)
case "${cur}" in
-*)
COMPREPLY=($(compgen -o default -W "$NXF_OPTIONS $PIPE_OPTIONS" -- ${cur}))
;;
*)
COMPREPLY=($(compgen -o default))
;;
esac
;;
validate)
COMPREPLY=($(compgen -f ${cur}))
;;
esac
;;
*)
COMPREPLY=()
;;
esac
}
# add command autocompletion
complete -o nospace -F _ci ci