-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdzil
More file actions
40 lines (30 loc) · 1 KB
/
Copy pathdzil
File metadata and controls
40 lines (30 loc) · 1 KB
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
# Bash completion for dzil:
# dzil <tab>
#
# Github: https://github.com/jonasbn/bash_completion_dzil
# Copyright Jonas B. Nielsen (jonasbn) 2017-2018
# MIT License
_dzil()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts=$(dzil commands | sed 's/\([[:alnum:]]\):.*/\1/')
#
# dzil authordeps <tab>
# dzil listdeps <tab>
#
if [[ "${prev}" == "listdeps" ]] ; then
local opts="--missing --develop --author --missing --requires --no-requires --recommends --no-recommends --suggests --no-suggests --versions --cpanm-versions --json --omit-cores"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
elif [[ "${prev}" == "authordeps" || "${prev}" == "listdeps" ]] ; then
local opts="--root --missing --versions"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
fi
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
}
complete -F _dzil dzil