Skip to content
Myr

Docs: several fixes

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Julen Ruiz Aizpuru · committed by Julen Ruiz Aizpuru · parent f0b559f · 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:click/core.py+2 added-2 removed
111 unmodified lines
112 :param terminal_width: the width of the terminal. The default is113 inherit from parent context. If no context114 defines the terminal width then auto115 detection will be applied.116 :param resilient_parsing: if this flag is enabled then the click will116 :param resilient_parsing: if this flag is enabled then click will117 parse without any interactivity or callback118 invocation. This is useful for implementing119 things such as completion support.120 """
30 unmodified lines
151 #: The width of the terminal (None is autodetection).152 self.terminal_width = terminal_width153154 #: Indicates if resilient parsing is enabled. In that case click155 #: will do it's best to not cause any failures.155 #: will do its best to not cause any failures.156 self.resilient_parsing = resilient_parsing157158 # If there is no envvar prefix yet, but the parent has one and159 # the command on this level has a name, we can expand the envvar
1094 unmodified lines
modified:click/termui.py+2 added-2 removed
444 unmodified lines
445 will always return a unicode character and under certain rare446 circumstances this might return more than one character. The447 situations which more than one character is returned is when for448 whatever reason multiple characters end up in the terminal buffer or449 standard in was not actually a terminal.449 standard input was not actually a terminal.450451 Note that this will always read from the terminal, even if something452 is piped into the standard input.453454 .. versionadded:: 2.0455456 :param echo: if set to True the character read will also show up on456 :param echo: if set to `True` the character read will also show up on457 the terminal. The default is not not show it.458 """459 f = _getchar460 if f is None:
2 unmodified lines
modified:docs/bashcomplete.rst+2 added-2 removed
2 unmodified lines
34.. versionadded:: 2.056Starting with click 2.0 there is built-in support for bash completion for7any Click script. There are certain restrictions on when this completion7any click script. There are certain restrictions on when this completion8is available but for the most part it should just work.910Limitations11-----------
29 unmodified lines
41with dashes replaced by underscores.4243So if your tool is called ``foo-bar`` then the magic variable is called44``_FOO_BAR_COMPLETE``. By exporting it with the ``source`` value it will45spit out the activation script which can be trivally be activated.45spit out the activation script which can be trivally activated.4647For instance to enable bash completion for your ``foo-bar`` script, this48is what you would need to put into your ``.bashrc``::49
20 unmodified lines
modified:docs/utils.rst+1 added-1 removed
120 unmodified lines
121to do that and instead read individual characters as they are being122written.123124For this click provides the :func:`getchar` function which reads a single125character from the terminal buffer and returns it as unicode character.125character from the terminal buffer and returns it as a unicode character.126127Note that this function will always read from the terminal, even if stdin128is instead a pipe.129
186 unmodified lines