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()
2353
2353
#
2354
2354
_comp_command ()
2355
2355
{
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
+
2356
2362
local offset i
2357
2363
2358
2364
# 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()
245
245
_comp_cmd_cd " $@ "
246
246
}
247
247
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
+
248
261
# ex: filetype=sh
You can’t perform that action at this time.
0 commit comments