-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bashrc
More file actions
20 lines (16 loc) · 506 Bytes
/
Copy path.bashrc
File metadata and controls
20 lines (16 loc) · 506 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# hp/hackpack completion
_hp_completions()
{
local cur prev
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
# Get all words except 'hp' or 'hackpack'
local words=("${COMP_WORDS[@]:1}")
# Call hp to get completions
local completions=$(hp --get-completions "${words[@]}" 2>/dev/null)
if [ -n "$completions" ]; then
COMPREPLY=( $(compgen -W "$completions" -- "$cur") )
fi
}
complete -F _hp_completions hp
complete -F _hp_completions hackpack