Skip to content
Myr

Added example for pager

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 54c90d0 · Browse files · 1 file+17 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+17 added−0 removed

  • other:+17 added−0 removed

1 file+17 added−0 removed

modified:docs/advanced.rst+17 added
96 unmodified lines
9798.. click:run::99100 invoke(cli, prog_name='cli', args=['dist'])101102Showing Long Texts103------------------104105In some situations you might want to show long texts on the terminal and106let a user scroll through it. This can be achieved by using the107:func:`echo_via_pager` function which works similar to the :func:`echo`108function but always writes to stdout and, if possible, through a pager.109110Example:111112.. click:example::113114 @click.command()115 def less():116 click.echo_via_pager('\n'.join('Line %d' % idx117 for idx in range(200)))