fix(ArgparseCompleter): adjust parsing for upstream private changes

The upstream private API for `_parse_optional` changed, needed to update this.
This commit is contained in:
Gil Forsyth 2024-11-04 16:02:06 -05:00 committed by Gil Forsyth
parent cd05822f9a
commit 8a65d4f449

View file

@ -543,6 +543,9 @@ class ArgparseCompleter:
if not act_res: if not act_res:
# it is not a option string: pass # it is not a option string: pass
break break
if isinstance(act_res, list):
assert len(act_res) == 1
act_res = act_res[0]
# it is a valid option and advance # it is a valid option and advance
self.remaining_args = self.remaining_args[1:] self.remaining_args = self.remaining_args[1:]
act, *_, value = act_res act, *_, value = act_res