Merge remote-tracking branch 'origin/8.0.x'
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by David Lord · committed by David Lord · parents 2198a8c, 490ac01 · Browse files · 4 files·+7 added−7 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
4 files+7 added−7 removed
- other:+7 added−7 removed
Provenance
- Commit
051d57c- Tree
42ab780- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent 1
2198a8c- Parent 2
490ac01
4 files changed+7 added−7 removed
modified:docs/options.rst+4 added-4 removed
557 unmodified lines558 parameter ``--foo`` was required and defined before, you would need to559 specify it for ``--version`` to work. For more information, see560 :ref:`callback-evaluation-order`.561 562-A callback is a function that is invoked with two parameters: the current563-:class:`Context` and the value. The context provides some useful features564-such as quitting the application and gives access to other already565-processed parameters.562+A callback is a function that is invoked with three parameters: the563+current :class:`Context`, the current :class:`Parameter`, and the value.564+The context provides some useful features such as quitting the565+application and gives access to other already processed parameters.566 567 Here an example for a ``--version`` flag:568 569 .. click:example::366 unmodified linesmodified:src/click/core.py+1 added-1 removed
2728 unmodified lines2729 self, ctx: Context, call: bool = True2730 ) -> t.Optional[t.Union[t.Any, t.Callable[[], t.Any]]]:2731 # If we're a non boolean flag our default is more complex because2732 # we need to look at all flags in the same group to figure out2733- # if we're the the default one in which case we return the flag2733+ # if we're the default one in which case we return the flag2734 # value as default.2735 if self.is_flag and not self.is_bool_flag:2736 for param in ctx.command.params:2737 if param.name == self.name and param.default:176 unmodified linesmodified:src/click/termui.py+1 added-1 removed
91 unmodified lines92 ) -> t.Any:93 """Prompts a user for input. This is a convenience function that can94 be used to prompt a user for input later.95 96- If the user aborts the input by sending a interrupt signal, this96+ If the user aborts the input by sending an interrupt signal, this97 function will catch it and raise a :exc:`Abort` exception.98 99 :param text: the text to show for the prompt.100 :param default: the default value to use if no input happens. If this686 unmodified linesmodified:src/click/types.py+1 added-1 removed
749 unmodified lines750 751 :param exists: The file or directory needs to exist for the value to752 be valid. If this is not set to ``True``, and the file does not753 exist, then all further checks are silently skipped.754- :param file_okay: Allow a file as a value value.754+ :param file_okay: Allow a file as a value.755 :param dir_okay: Allow a directory as a value.756 :param writable: The file or directory must be writable.757 :param readable: The file or directory must be readable.758 :param resolve_path: Make the value absolute and resolve any291 unmodified lines