Skip to content

Commit 19a3798

Browse files
committed
refactor: _split_longopt -> _comp__split_longopt
1 parent 45f37f3 commit 19a3798

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

bash_completion

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ _filedir()
797797
# this to be useful.
798798
# Returns 0 if current option was split, 1 otherwise.
799799
#
800-
_split_longopt()
800+
_comp__split_longopt()
801801
{
802802
if [[ $cur == --?*=* ]]; then
803803
# Cut also backslash before '=' in case it ended up there
@@ -977,7 +977,7 @@ _comp_variable_assignments()
977977
# -e XSPEC Passed to _filedir as first arg for stderr redirections
978978
# -o XSPEC Passed to _filedir as first arg for other output redirections
979979
# -i XSPEC Passed to _filedir as first arg for stdin redirections
980-
# -s Split long options with _split_longopt, implies -n =
980+
# -s Split long options with _comp__split_longopt, implies -n =
981981
# @param $1...$3 args Original arguments specified to the completion function.
982982
# The first argument $1 is command name. The second
983983
# argument $2 is the string before the cursor in the
@@ -1066,7 +1066,7 @@ _comp_initialize()
10661066
((cword <= 0)) && return 1
10671067
prev=${words[cword - 1]}
10681068

1069-
[[ $opt_split ]] && _split_longopt && was_split="set"
1069+
[[ $opt_split ]] && _comp__split_longopt && was_split="set"
10701070

10711071
return 0
10721072
}

bash_completion.d/000_bash_completion_compat.bash

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ _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
1515
_comp_deprecate_func _longopt _comp_longopt
16+
_comp_deprecate_func _split_longopt _comp__split_longopt
1617

1718
# Backwards compatibility for compat completions that use have().
1819
# @deprecated should no longer be used; generally not needed with dynamically
@@ -189,7 +190,7 @@ _realcommand()
189190
# -e XSPEC Passed to _filedir as first arg for stderr redirections
190191
# -o XSPEC Passed to _filedir as first arg for other output redirections
191192
# -i XSPEC Passed to _filedir as first arg for stdin redirections
192-
# -s Split long options with _split_longopt, implies -n =
193+
# -s Split long options with _comp__split_longopt, implies -n =
193194
# @var[out] cur Reconstructed current word
194195
# @var[out] prev Reconstructed previous word
195196
# @var[out] words Reconstructed words

completions/_xm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ _comp_cmd_xm()
1515
local cur prev words cword comp_args
1616
_comp_initialize -- "$@" || return
1717

18-
# TODO: _split_longopt
18+
# TODO: split longopt
1919

2020
local args command commands options
2121

doc/styleguide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ available in `COMPREPLY`.
8181
## `[[ $was_split ]] && return`
8282

8383
Should be used in completions using the `-s` flag of `_comp_initialize`,
84-
or other similar cases where `_split_longopt` has been invoked, after
84+
or other similar cases where `_comp__split_longopt` has been invoked, after
8585
`$prev` has been managed but before `$cur` is considered. If `$cur` of the
8686
form `--foo=bar` was split into `prev=--foo` and `cur=bar`, and the `$prev`
8787
block did not process the option argument completion, it makes sense to return

0 commit comments

Comments
 (0)