-
Notifications
You must be signed in to change notification settings - Fork 9
/
_rdf
44 lines (36 loc) · 1.15 KB
/
_rdf
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
#compdef rdf
_rdfshInputFile () {
local expl
_wanted files expl 'RDF File' _files -g '*.(#i)(rdf|n3|nt|owl|ttl)(.)'
}
_rdfshResourceHistory () {
typeset -a rhistory
local resource
tail $HOME/.cache/rdf.sh/resource.history 2> /dev/null | sed -e 's/:/\\\\:/g' | while read resource
do
rhistory+=(${resource/ # [0-9]#:*})
done
_describe -t rhistory 'resource history' rhistory
}
_rdf() {
if [ "$CURRENT" -eq "2" ]
then
_describe -t command "RDF commands" "`rdf zshcomp`"
else
#_wanted files expl 'RDF Files' _files -g '*.(#i)(rdf|n3|owl|nt|xml|ttl)(.)'
_alternative 'files:RDF File:_rdfshInputFile' 'rhistory:resource history:_rdfshResourceHistory'
fi
#local cmd expl
#`rdf zshcomp`
#local args=(eins:Einmal zwei:ttt)
#_files -J "RDF files" -g '*.(#i)rdf.'
#_describe 'Argument' args
#_describe -t command "commands" args
#_description files expl 'RDF files'
#_files "$expl[@]" -g '*.(#i)(rdf|n3|owl|nt|xml)(.)'
#
#_arguments '-n[]' '-e[enable]'
#_arguments `rdf zshcomp`
#_arguments '-ntt[tt]' '-ett[enable]'
}
compdef _rdf rdf rdf.sh