2011-07-19 11:48:15 +02:00
|
|
|
#compdef rdf
|
|
|
|
|
|
|
|
_rdfshInputFile () {
|
|
|
|
local expl
|
|
|
|
_wanted files expl 'RDF File' _files -g '*.(#i)(rdf|n3|nt|owl|tt)(.)'
|
|
|
|
}
|
|
|
|
|
|
|
|
_rdfshResourceHistory () {
|
|
|
|
typeset -a rhistory
|
2011-09-27 23:32:35 +02:00
|
|
|
local resource
|
|
|
|
tail $HOME/.cache/rdf.sh/resource.history 2> /dev/null | tac | sed 's/:/\\\\:/' | while read resource
|
2011-07-19 11:48:15 +02:00
|
|
|
do
|
2011-09-27 23:32:35 +02:00
|
|
|
rhistory+=(${resource/ # [0-9]#:*})
|
2011-07-19 11:48:15 +02:00
|
|
|
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
|
|
|
|
|