summaryrefslogtreecommitdiff
path: root/docs/utils.rst
diff options
context:
space:
mode:
authorArmin Ronacher <armin.ronacher@active-4.com>2014-05-31 20:30:02 +0600
committerArmin Ronacher <armin.ronacher@active-4.com>2014-05-31 20:30:02 +0600
commitc9eb780225e71eb3c1444871b4b5179ff160d91e (patch)
tree23945a97cf3da5d82640760051716dbffc631299 /docs/utils.rst
parent525cc941ce2fa20d44ad108b57250291872f0577 (diff)
downloadclick-c9eb780225e71eb3c1444871b4b5179ff160d91e.tar.gz
Added click.pause
Diffstat (limited to 'docs/utils.rst')
-rw-r--r--docs/utils.rst21
1 files changed, 21 insertions, 0 deletions
diff --git a/docs/utils.rst b/docs/utils.rst
index 099066f..4692b2e 100644
--- a/docs/utils.rst
+++ b/docs/utils.rst
@@ -149,6 +149,27 @@ too easy to forget about that and to create scripts that cannot be
properly exited.
+Waiting for Key Press
+---------------------
+
+.. versionadded:: 2.0
+
+Sometimes it's useful to pause until the user presses any key on the
+keyboard. This is especially useful on windows where ``cmd.exe`` by
+default will close the window at the end of the command execution instead
+of waiting.
+
+In click this can be accomplished by the :func:`pause` function. This
+function will print a quick message to the terminal (which can be
+customized) and wait for the user to press a key. In addition to that
+it will also become a noop if the script is not run interactively.
+
+Example::
+
+ import click
+ click.pause()
+
+
Launching Editors
-----------------