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
44
45
46
47
48
49
50
51
52
|
#compdef inquisitio
#
# vim: set et sw=4 sts=4 ts=4 ft=zsh :
# ZSH completion for adjutrix
# Written by Baptiste Daroussin <baptux at free.fr>
_inquisitio() {
local actions actions_options general_options matching_options filter_options output_options
actions=(
--search -s
--version -V
--help -h
)
matching_options=(
"(--keys -k)"{-k,--keys}"[Match using listed metadata keys]:Key: "
"(--matcher -m)"{-m,--matcher}"[Which match algorithm to use]:algorithm:((text\:Simple\ text\ match pcre\:Regular\ expression exact\:Exact\ text\ match))"
"(--flatten -f)"{-f,--flatten}"[Flatten spec trees, rather than matching against individual items]"
"(--enabled-only -e)"{-e,--enabled-only}"[When searching spec trees, only look in enabled subtrees]"
"(--not -n)"{-n,--not}"[Select packages that do not match]"
)
filter_options=(
"(--repository -r)"{-r,--repository}"[Matches with this repository name only]:repository:_paludis_packages repositories"
"--repository-format[Matches with this repository format only]:format:_paludis_packages repository-formats"
"--category[Matches with this category name only]:category:_paludis_packages categories"
"--package[Matches with this package name only]:package:_paludis_packages available"
"(--visible-only -v)"{-v,--visible-only}"[Only consider visible packages]"
"(--all-versions -a)"{-a,--all-versions}"[Check all versions, rather than only one]"
"(--kind -k)"{-k,--kind}"[Packages of this kind only]:((installable\:Installable\ packages installed\:Installed\ packages all\:All\ packages))"
)
general_options=(
'--log-level[Specify the log level]:log level:((debug\:"Show debug output (noisy)" qa\:"Show QA messages and warnings only (default)" warning\:"Show warnings only" silent\:"Suppress all log messages (UNSAFE)"))'
"(--no-colour --no-color)"{--no-colour,--no-color}"[Do not use colour]"
"(--environment -E)"{-E,--environment}"[Environment specification]:Environment: "
)
output_options=(
"--compact[Display output using one line per entry]"
"(--show-dependencies -D)"{-D,--show-dependencies}"[Show dependencies]"
"(--show-metadata -M)"{-M,--show-metadata}"[Show raw metadata]"
)
action_options=(
"($actions)"{--search,-s}"[Search for a package]"
"(: -)"{--version,-V}"[Display program version]"
"(: -)"{--help,-h}"[Display program help]"
)
_arguments -s \
$general_options[@] $output_options[@] $filter_options[@] $matching_options[@] $action_options[@] && return 0
}
_inquisitio "$@"
|