MCPcopy
hub / github.com/pallets/click / _is_incomplete_argument

Function _is_incomplete_argument

src/click/shell_completion.py:543–563  ·  view source on GitHub ↗

Determine if the given parameter is an argument that can still accept values. :param ctx: Invocation context for the command represented by the parsed complete args. :param param: Argument object being checked.

(ctx: Context, param: Parameter)

Source from the content-addressed store, hash-verified

541
542
543def _is_incomplete_argument(ctx: Context, param: Parameter) -> bool:
544 """Determine if the given parameter is an argument that can still
545 accept values.
546
547 :param ctx: Invocation context for the command represented by the
548 parsed complete args.
549 :param param: Argument object being checked.
550 """
551 if not isinstance(param, Argument):
552 return False
553
554 value = ctx.params.get(param.name)
555 return (
556 param.nargs == -1
557 or ctx.get_parameter_source(param.name) is not ParameterSource.COMMANDLINE
558 or (
559 param.nargs > 1
560 and isinstance(value, (tuple, list))
561 and len(value) < param.nargs
562 )
563 )
564
565
566def _start_of_option(ctx: Context, value: str) -> bool:

Callers 1

_resolve_incompleteFunction · 0.85

Calls 1

get_parameter_sourceMethod · 0.80

Tested by

no test coverage detected