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

Method get_parameter_source

src/click/core.py:937–953  ·  view source on GitHub ↗

Get the source of a parameter. This indicates the location from which the value of the parameter was obtained. This can be useful for determining when a user specified a value on the command line that is the same as the default value. It will be :attr:`~click.core.Pa

(self, name: str)

Source from the content-addressed store, hash-verified

935 self._parameter_source[name] = source
936
937 def get_parameter_source(self, name: str) -> ParameterSource | None:
938 """Get the source of a parameter. This indicates the location
939 from which the value of the parameter was obtained.
940
941 This can be useful for determining when a user specified a value
942 on the command line that is the same as the default value. It
943 will be :attr:`~click.core.ParameterSource.DEFAULT` only if the
944 value was actually taken from the default.
945
946 :param name: The name of the parameter.
947 :rtype: ParameterSource
948
949 .. versionchanged:: 8.0
950 Returns ``None`` if the parameter was not provided from any
951 source.
952 """
953 return self._parameter_source.get(name)
954
955
956class Command:

Callers 9

shell_completeMethod · 0.80
handle_parse_resultMethod · 0.80
_is_incomplete_argumentFunction · 0.80
cliFunction · 0.80
convertMethod · 0.80
eager_cbFunction · 0.80
set_debugFunction · 0.80
cliFunction · 0.80
cliFunction · 0.80

Calls

no outgoing calls

Tested by 6

cliFunction · 0.64
convertMethod · 0.64
eager_cbFunction · 0.64
set_debugFunction · 0.64
cliFunction · 0.64
cliFunction · 0.64