Skip to content

Commit 909fe14

Browse files
committed
refactor: apply more guidelines where API is as desired
1 parent 7bc7bc0 commit 909fe14

File tree

21 files changed

+63
-62
lines changed

21 files changed

+63
-62
lines changed

completions/aspell

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# bash completion for aspell -*- shell-script -*-
22

3-
_aspell_dictionary()
3+
_comp_cmd_aspell__dictionary()
44
{
55
local datadir aspell=${1:-aspell}
66
datadir=$("$aspell" config data-dir 2>/dev/null || echo /usr/lib/aspell)
@@ -49,7 +49,7 @@ _comp_cmd_aspell()
4949
return
5050
;;
5151
-d | --master)
52-
_aspell_dictionary "$1"
52+
_comp_cmd_aspell__dictionary "$1"
5353
return
5454
;;
5555
--add-filter | --rem-filter)

completions/kldload

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[[ $OSTYPE == *freebsd* ]] || return 1
44

5-
_kldload()
5+
_comp_cmd_kldload()
66
{
77
local cur prev words cword comp_args
88
_comp_initialize -- "$@" || return
@@ -28,6 +28,6 @@ _kldload()
2828
_filedir -d
2929

3030
} &&
31-
complete -F _kldload kldload
31+
complete -F _comp_cmd_kldload kldload
3232

3333
# ex: filetype=sh

completions/snownews

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# snownews(1) completion -*- shell-script -*-
22

3-
_snownews()
3+
_comp_cmd_snownews()
44
{
55
local cur prev words cword comp_args
66
_comp_initialize -- "$@" || return
@@ -10,6 +10,6 @@ _snownews()
1010
COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur"))
1111
fi
1212
} &&
13-
complete -F _snownews snownews
13+
complete -F _comp_cmd_snownews snownews
1414

1515
# ex: filetype=sh

completions/sqlite3

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# sqlite3(1) completion -*- shell-script -*-
22

3-
_sqlite3()
3+
_comp_cmd_sqlite3()
44
{
55
local cur prev words cword comp_args
66
_comp_initialize -- "$@" || return
@@ -33,6 +33,6 @@ _sqlite3()
3333

3434
_filedir "$dbexts"
3535
} &&
36-
complete -F _sqlite3 sqlite3
36+
complete -F _comp_cmd_sqlite3 sqlite3
3737

3838
# ex: filetype=sh

completions/ss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ss(8) completion -*- shell-script -*-
22

3-
_ss()
3+
_comp_cmd_ss()
44
{
55
local cur prev words cword was_split comp_args
66
_comp_initialize -s -- "$@" || return
@@ -38,6 +38,6 @@ _ss()
3838
close-wait last-ack listening closing' -- "$cur"))
3939
fi
4040
} &&
41-
complete -F _ss ss
41+
complete -F _comp_cmd_ss ss
4242

4343
# ex: filetype=sh

completions/ssh

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ssh(1) completion -*- shell-script -*-
22

3-
_ssh_queries()
3+
_comp_cmd_ssh__queries()
44
{
55
local queries=$(_comp_xfunc_ssh_query "$1" help)
66
[[ $queries ]] || queries="cipher cipher-auth mac kex key key-cert
@@ -17,7 +17,7 @@ _comp_xfunc_ssh_query()
1717

1818
_comp_deprecate_func _ssh_query _comp_xfunc_ssh_query
1919

20-
_ssh_ciphers()
20+
_comp_cmd_ssh__ciphers()
2121
{
2222
local ciphers=$(_comp_xfunc_ssh_query "$1" cipher)
2323
[[ $ciphers ]] || ciphers="3des-cbc aes128-cbc aes192-cbc aes256-cbc
@@ -26,7 +26,7 @@ _ssh_ciphers()
2626
COMPREPLY+=($(compgen -W "$ciphers" -- "$cur"))
2727
}
2828

29-
_ssh_macs()
29+
_comp_cmd_ssh__macs()
3030
{
3131
local macs=$(_comp_xfunc_ssh_query "$1" mac)
3232
[[ $macs ]] || macs="hmac-md5 hmac-sha1 umac-64@openssh.com hmac-ripemd160
@@ -90,7 +90,7 @@ _comp_deprecate_func _ssh_options _comp_xfunc_ssh_options
9090
# the ssh executable to invoke (optional).
9191
# Not all suboptions are completed.
9292
# Doesn't handle comma-separated lists.
93-
_ssh_suboption()
93+
_comp_cmd_ssh__suboption()
9494
{
9595
# Split into subopt and subval
9696
local prev=${1%%=*} cur=${1#*=}
@@ -138,7 +138,7 @@ _ssh_suboption()
138138
COMPREPLY=($(compgen -W 'blowfish des 3des' -- "$cur"))
139139
;;
140140
ciphers)
141-
_ssh_ciphers "$2"
141+
_comp_cmd_ssh__ciphers "$2"
142142
;;
143143
controlmaster)
144144
COMPREPLY=($(compgen -W 'yes ask auto autoask no' -- "$cur"))
@@ -166,7 +166,7 @@ _ssh_suboption()
166166
))
167167
;;
168168
macs)
169-
_ssh_macs "$2"
169+
_comp_cmd_ssh__macs "$2"
170170
;;
171171
pkcs11provider)
172172
_filedir so
@@ -220,7 +220,7 @@ _comp_xfunc_ssh_suboption_check()
220220
local cur prev
221221
_comp_get_words -n := cur prev
222222
if [[ $cur == *=* && $prev == -*o ]]; then
223-
_ssh_suboption "$cur" "${1-}"
223+
_comp_cmd_ssh__suboption "$cur" "${1-}"
224224
return $?
225225
fi
226226
return 1
@@ -261,7 +261,7 @@ _comp_xfunc_ssh_identityfile()
261261

262262
_comp_deprecate_func _ssh_identityfile _comp_xfunc_ssh_identityfile
263263

264-
_ssh()
264+
_comp_cmd_ssh()
265265
{
266266
local cur prev words cword comp_args
267267
_comp_initialize -n : -- "$@" || return
@@ -285,7 +285,7 @@ _ssh()
285285
return
286286
;;
287287
-*c)
288-
_ssh_ciphers "$1"
288+
_comp_cmd_ssh__ciphers "$1"
289289
return
290290
;;
291291
-*[DeLpRW])
@@ -312,7 +312,7 @@ _ssh()
312312
return
313313
;;
314314
-*m)
315-
_ssh_macs "$1"
315+
_comp_cmd_ssh__macs "$1"
316316
return
317317
;;
318318
-*O)
@@ -324,7 +324,7 @@ _ssh()
324324
return
325325
;;
326326
-*Q)
327-
_ssh_queries "$1"
327+
_comp_cmd_ssh__queries "$1"
328328
return
329329
;;
330330
-*w)
@@ -360,11 +360,12 @@ _ssh()
360360
fi
361361
fi
362362
} &&
363-
shopt -u hostcomplete && complete -F _ssh ssh slogin autossh sidedoor
363+
shopt -u hostcomplete &&
364+
complete -F _comp_cmd_ssh ssh slogin autossh sidedoor
364365

365366
# sftp(1) completion
366367
#
367-
_sftp()
368+
_comp_cmd_sftp()
368369
{
369370
local cur prev words cword comp_args
370371
_comp_initialize -- "$@" || return
@@ -389,7 +390,7 @@ _sftp()
389390
return
390391
;;
391392
-*c)
392-
_ssh_ciphers
393+
_comp_cmd_ssh__ciphers
393394
return
394395
;;
395396
-*J)
@@ -425,7 +426,7 @@ _sftp()
425426
_known_hosts_real ${ipvx:+"$ipvx"} -a ${configfile:+-F "$configfile"} -- "$cur"
426427
fi
427428
} &&
428-
shopt -u hostcomplete && complete -F _sftp sftp
429+
shopt -u hostcomplete && complete -F _comp_cmd_sftp sftp
429430

430431
# things we want to backslash escape in scp paths
431432
# shellcheck disable=SC2089
@@ -504,7 +505,7 @@ _comp_deprecate_func _scp_local_files _comp_xfunc_ssh_scp_local_files
504505

505506
# scp(1) completion
506507
#
507-
_scp()
508+
_comp_cmd_scp()
508509
{
509510
local cur prev words cword comp_args
510511
_comp_initialize -n : -- "$@" || return
@@ -521,7 +522,7 @@ _scp()
521522

522523
case $prev in
523524
-*c)
524-
_ssh_ciphers
525+
_comp_cmd_ssh__ciphers
525526
COMPREPLY=("${COMPREPLY[@]/%/ }")
526527
return
527528
;;
@@ -593,6 +594,6 @@ _scp()
593594

594595
_comp_xfunc_ssh_scp_local_files "${prefix-}"
595596
} &&
596-
complete -F _scp -o nospace scp
597+
complete -F _comp_cmd_scp -o nospace scp
597598

598599
# ex: filetype=sh

completions/ssh-add

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ssh-add(1) completion -*- shell-script -*-
22

3-
_ssh_add()
3+
_comp_cmd_ssh_add()
44
{
55
local cur prev words cword comp_args
66
_comp_initialize -- "$@" || return
@@ -30,6 +30,6 @@ _ssh_add()
3030

3131
_filedir
3232
} &&
33-
complete -F _ssh_add ssh-add
33+
complete -F _comp_cmd_ssh_add ssh-add
3434

3535
# ex: filetype=sh

completions/ssh-copy-id

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ssh-copy-id(1) completion -*- shell-script -*-
22

3-
_ssh_copy_id()
3+
_comp_cmd_ssh_copy_id()
44
{
55
local cur prev words cword comp_args
66
_comp_initialize -- "$@" || return
@@ -27,6 +27,6 @@ _ssh_copy_id()
2727
_known_hosts_real -a -- "$cur"
2828
fi
2929
} &&
30-
complete -F _ssh_copy_id ssh-copy-id
30+
complete -F _comp_cmd_ssh_copy_id ssh-copy-id
3131

3232
# ex: filetype=sh

completions/ssh-keygen

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ssh-keygen(1) completion -*- shell-script -*-
22

3-
_ssh_keygen()
3+
_comp_cmd_ssh_keygen()
44
{
55
local cur prev words cword comp_args
66
_comp_initialize -n := -- "$@" || return
@@ -126,6 +126,6 @@ _ssh_keygen()
126126
_filedir pub
127127
fi
128128
} &&
129-
complete -F _ssh_keygen ssh-keygen
129+
complete -F _comp_cmd_ssh_keygen ssh-keygen
130130

131131
# ex: filetype=sh

completions/sshfs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# sshfs(1) completion -*- shell-script -*-
22

3-
_sshfs()
3+
_comp_cmd_sshfs()
44
{
55
local cur prev words cword comp_args
66
_comp_initialize -n : -- "$@" || return
@@ -18,6 +18,6 @@ _sshfs()
1818

1919
_comp_xfunc ssh scp_local_files -d
2020
} &&
21-
complete -F _sshfs -o nospace sshfs
21+
complete -F _comp_cmd_sshfs -o nospace sshfs
2222

2323
# ex: filetype=sh

0 commit comments

Comments
 (0)