File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -2353,6 +2353,12 @@ _comp_command_offset()
23532353#
23542354_comp_command ()
23552355{
2356+ # We unset the shell variable `words` locally to tell
2357+ # `_comp_command_offset` that the index is intended to be that in
2358+ # `COMP_WORDS` instead of `words`.
2359+ local words
2360+ unset -v words
2361+
23562362 local offset i
23572363
23582364 # find actual offset, as position of the first non-option
Original file line number Diff line number Diff line change @@ -245,4 +245,17 @@ _cd()
245245 _comp_cmd_cd " $@ "
246246}
247247
248+ # @deprecated Use `_comp_command_offset` instead. Note that the new interface
249+ # `_comp_command_offset` is changed to receive an index in `words` instead of
250+ # that in `COMP_WORDS` as `_command_offset` did.
251+ _command_offset ()
252+ {
253+ # We unset the shell variable `words` locally to tell
254+ # `_comp_command_offset` that the index is intended to be that in
255+ # `COMP_WORDS` instead of `words`.
256+ local words
257+ unset -v words
258+ _comp_command_offset " $@ "
259+ }
260+
248261# ex: filetype=sh
You can’t perform that action at this time.
0 commit comments