Skip to content
Myr

Added --version cross reference

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

authored by Armin Ronacher · committed by Armin Ronacher · parent 6a03b34 · Browse files · 1 file+4 added−0 removed
This commit

State

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

Diff stats

1 file+4 added−0 removed

  • other:+4 added−0 removed

1 file+4 added−0 removed

modified:docs/options.rst+4 added
299 unmodified lines
300Sometimes, you want a parameter to completely change the execution flow.301For instance, this is the case when you want to have a ``--version``302parameter that prints out the version and then exits the application.303304Note: an actual implementation of a ``--version`` parameter that is305reusable is available in Click as :func:`click.version_option`. The code306here is merely an example of how to implement such a flag.307308In such cases, you need two concepts: eager parameters and a callback. An309eager parameter is a parameter that is handled before others, and a310callback is what executes after the parameter is handled. The eagerness311is necessary so that an earlier required parameter does not produce an
304 unmodified lines