Skip to content

Commit 80da3de

Browse files
committed
refactor(iconv): _comp_xfunc_iconv_charsets main command convention
1 parent 0d27563 commit 80da3de

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

completions/iconv

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,20 @@
33
# @since 2.12
44
_comp_xfunc_iconv_charsets()
55
{
6-
COMPREPLY+=($(compgen -X ... -W '$("${1:-iconv}" -l | \
7-
command sed -e "s@/*\$@@" -e "s/[,()]//g")' -- "$cur"))
6+
_comp_cmd_iconv__charsets iconv
7+
}
8+
9+
# @deprecated 2.12 use `_comp_xfunc_iconv_charsets` instead
10+
_iconv_charsets()
11+
{
12+
_comp_cmd_iconv__charsets "${1:-iconv}"
813
}
914

10-
_comp_deprecate_func 2.12 _iconv_charsets _comp_xfunc_iconv_charsets
15+
_comp_cmd_iconv__charsets()
16+
{
17+
COMPREPLY+=($(compgen -X ... -W '$("$1" -l | \
18+
command sed -e "s@/*\$@@" -e "s/[,()]//g")' -- "$cur"))
19+
}
1120

1221
_comp_cmd_iconv()
1322
{
@@ -22,7 +31,7 @@ _comp_cmd_iconv()
2231
return
2332
;;
2433
--from-code | --to-code | -${noargopts}[ft])
25-
_comp_xfunc_iconv_charsets "$1"
34+
_comp_cmd_iconv__charsets "$1"
2635
return
2736
;;
2837
--output | -${noargopts}o)

0 commit comments

Comments
 (0)