Skip to content
Myr

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

4 files+7 added−7 removed

modified:docs/options.rst+4 added-4 removed
557 unmodified lines
558parameter ``--foo`` was required and defined before, you would need to559specify it for ``--version`` to work. For more information, see560:ref:`callback-evaluation-order`.561562A callback is a function that is invoked with two parameters: the current563:class:`Context` and the value. The context provides some useful features564such as quitting the application and gives access to other already565processed parameters.562A callback is a function that is invoked with three parameters: the563current :class:`Context`, the current :class:`Parameter`, and the value.564The context provides some useful features such as quitting the565application and gives access to other already processed parameters.566567Here an example for a ``--version`` flag:568569.. click:example::
366 unmodified lines
modified:src/click/core.py+1 added-1 removed
2728 unmodified lines
2729 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 lines
modified:src/click/termui.py+1 added-1 removed
91 unmodified lines
92) -> t.Any:93 """Prompts a user for input. This is a convenience function that can94 be used to prompt a user for input later.9596 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.9899 :param text: the text to show for the prompt.100 :param default: the default value to use if no input happens. If this
686 unmodified lines
modified:src/click/types.py+1 added-1 removed
749 unmodified lines
750751 :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 any
291 unmodified lines