-
Notifications
You must be signed in to change notification settings - Fork 411
Expand file tree
/
Copy pathmech-dump
More file actions
36 lines (30 loc) · 865 Bytes
/
mech-dump
File metadata and controls
36 lines (30 loc) · 865 Bytes
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
#!/usr/bin/env bash
# Simultaneously committed to https://github.com/libwww-perl/WWW-Mechanize
__mech_dump_init_completion() {
COMPREPLY=()
_get_comp_words_by_ref cur prev words cword
}
__mech_dump_command_line_options() {
opts=(
--headers --forms --links --images --all --test
--user= --password= --cookie-file= --agent
--agent-alias= --absolute --help --version
*
)
echo "${opts[*]}"
}
_mech_dump() {
local cur
if declare -F _init_completion >/dev/null 2>&1; then
_init_completion
else
__mech_dump_init_completion
fi
keys=( )
cur=${COMP_WORDS[COMP_CWORD]}
keys+=( "$(__mech_dump_command_line_options)" )
# shellcheck disable=SC2207
COMPREPLY=( $( compgen -W "${keys[*]}" -- "$cur" ) )
return 0
}
complete -F _mech_dump mech-dump