Skip to content

Commit 45f37f3

Browse files
committed
refactor: _longopt -> _comp_longopt
1 parent ec49676 commit 45f37f3

File tree

7 files changed

+10
-8
lines changed

7 files changed

+10
-8
lines changed

bash_completion

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2370,7 +2370,7 @@ _complete_as_root()
23702370
[[ $EUID -eq 0 || ${root_command-} ]]
23712371
}
23722372

2373-
_longopt()
2373+
_comp_longopt()
23742374
{
23752375
local cur prev words cword was_split comp_args
23762376
_comp_initialize -s -- "$@" || return
@@ -2420,7 +2420,8 @@ _longopt()
24202420
fi
24212421
}
24222422
# makeinfo and texi2dvi are defined elsewhere.
2423-
complete -F _longopt a2ps awk base64 bash bc bison cat chroot colordiff cp \
2423+
complete -F _comp_longopt \
2424+
a2ps awk base64 bash bc bison cat chroot colordiff cp \
24242425
csplit cut date df diff dir du enscript env expand fmt fold gperf \
24252426
grep grub head irb ld ldd less ln ls m4 mkdir mkfifo mknod \
24262427
mv netstat nl nm objcopy objdump od paste pr ptx readelf rm rmdir \

bash_completion.d/000_bash_completion_compat.bash

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ _comp_deprecate_func _upvars _comp_upvars
1212
_comp_deprecate_func __reassemble_comp_words_by_ref _comp__reassemble_words
1313
_comp_deprecate_func __get_cword_at_cursor_by_ref _comp__get_cword_at_cursor
1414
_comp_deprecate_func _get_comp_words_by_ref _comp_get_words
15+
_comp_deprecate_func _longopt _comp_longopt
1516

1617
# Backwards compatibility for compat completions that use have().
1718
# @deprecated should no longer be used; generally not needed with dynamically

completions/abook

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ _comp_cmd_abook()
1515

1616
case $cur in
1717
-*)
18-
_longopt "$@"
18+
_comp_longopt "$@"
1919
return
2020
;;
2121
esac

completions/pyvenv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ _comp_cmd_pyvenv()
1414
[[ $was_split ]] && return
1515

1616
if [[ $cur == -* ]]; then
17-
_longopt "$@"
17+
_comp_longopt "$@"
1818
return
1919
fi
2020

completions/sha256sum

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ _comp_cmd_sha256sum()
1414
[[ $was_split ]] && return
1515

1616
if [[ $cur == -* ]]; then
17-
_longopt "$@"
17+
_comp_longopt "$@"
1818
return
1919
fi
2020

test/t/test_grep.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def test_2(self, completion):
1111
"""
1212
Test --no-*dir isn't restricted to dirs only.
1313
14-
Not really a grep option, but tests _longopt.
14+
Not really a grep option, but tests _comp_longopt.
1515
"""
1616
assert completion == "foo foo.d/".split()
1717

test/t/unit/test_unit_longopt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ class TestUnitLongopt:
1010
@pytest.fixture(scope="class")
1111
def functions(self, request, bash):
1212
assert_bash_exec(bash, "_grephelp() { cat _longopt/grep--help.txt; }")
13-
assert_bash_exec(bash, "complete -F _longopt _grephelp")
13+
assert_bash_exec(bash, "complete -F _comp_longopt _grephelp")
1414
assert_bash_exec(bash, "_various() { cat _longopt/various.txt; }")
15-
assert_bash_exec(bash, "complete -F _longopt _various")
15+
assert_bash_exec(bash, "complete -F _comp_longopt _various")
1616

1717
@pytest.mark.complete("_grephelp --")
1818
def test_1(self, functions, completion):

0 commit comments

Comments
 (0)