about summary refs log tree commit homepage
path: root/examples/zsh-completion/_dtas-mlib
blob: 24418ea014b571fa82a76684b38ad72255cfb46c (plain)
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
#compdef dtas-mlib

# To the extent possible under law, James Rowe has waived all copyright and
# related or neighboring rights to this example.
#
_arguments \
    "--database=[database]:select file:_files" \
    "--force[force updates]" \
    "--help[display help message]" \
    ':dtas-mlib action:((
            dump\:"dump database"
            search\:"search database"
            stats\:"display statistics"
            update\:"migrate database"
        ))' \
    "*::subcmd:->subcmd" && return 0

case "$words[1]" in
(dump|update)
    _arguments -S \
        ":select directory:_path_files -/"
    ;;
(search)
    _arguments -S \
        "*:search term:"
    ;;
(*)
    ;;
esac