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)
| 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 | |
| 956 | class Command: |
no outgoing calls