Override to support nargs ranges.
(self, action: argparse.Action, arg_strings_pattern: str)
| 895 | return super()._get_nargs_pattern(action) |
| 896 | |
| 897 | def _match_argument(self, action: argparse.Action, arg_strings_pattern: str) -> int: |
| 898 | """Override to support nargs ranges.""" |
| 899 | nargs_pattern = self._get_nargs_pattern(action) |
| 900 | match = re.match(nargs_pattern, arg_strings_pattern) |
| 901 | |
| 902 | # raise an exception if we weren't able to find a match |
| 903 | if match is None: |
| 904 | nargs_range = action.get_nargs_range() # type: ignore[attr-defined] |
| 905 | if nargs_range is not None: |
| 906 | raise ArgumentError(action, build_range_error(nargs_range[0], nargs_range[1])) |
| 907 | |
| 908 | return super()._match_argument(action, arg_strings_pattern) |
| 909 | |
| 910 | def _check_value(self, action: argparse.Action, value: Any) -> None: |
| 911 | """Override that supports CompletionItems as choices. |
nothing calls this directly
no test coverage detected