File tree Expand file tree Collapse file tree
bash-completion/completions Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Other Content
2+
3+ ## Command Completion
4+
5+ ### Installation
6+
7+ For Bash:
8+
9+ Copy the completion script to operating sytem specific folder, e.g.
10+
11+ * /usr/share/bash-completion/completions/
12+ * /etc/bash_completion.d
13+
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ __mech_dump_init_completion () {
4+ COMPREPLY=()
5+ _get_comp_words_by_ref cur prev words cword
6+ }
7+ __mech_dump_command_line_options () {
8+ opts=(
9+ --headers --forms --links --images --all --test
10+ --user= --password= --cookie-file= --agent
11+ --agent-alias= --absolute --help --version
12+ *
13+ )
14+ echo " ${opts[*]} "
15+ }
16+
17+ _mech_dump () {
18+ local cur
19+ if declare -F _init_completion > /dev/null 2>&1 ; then
20+ _init_completion
21+ else
22+ __mech_dump_init_completion
23+ fi
24+
25+ keys=( )
26+ cur=${COMP_WORDS[COMP_CWORD]}
27+
28+ keys+=( " $( __mech_dump_command_line_options) " )
29+ # shellcheck disable=SC2207
30+ COMPREPLY=( $( compgen -W " ${keys[*]} " -- " $cur " ) )
31+ return 0
32+ }
33+
34+ complete -F _mech_dump mech-dump
You can’t perform that action at this time.
0 commit comments