Artifact Content
Not logged in

Artifact fcb36b16802c79f13602db2ae9459aee9fc5549b:

[comment {-*- tcl -*- doctools manpage}]
[include parts/]
[vset VERSION 1]
[manpage_begin [vset LABEL_PAGER] [vset MAN_SECTION] [vset VERSION]]
[include parts/]
[require linenoise]
[require cmdr::tty]
[require cmdr::pager]
[titledesc [vset TITLE_PAGER]]
[include parts/]

This package provides a single utility command to manage the automatic
paging of long output, like it is done [vset PROJECT]'s automatic help.

[section API]
[list_begin definitions]
[comment {- - -- --- ----- -------- -------------}]
[call [cmd ::cmdr::pager] [method text]]

When invoked this command either simply prints the [arg text] to stdout,
or invokes an external pager application to manage the output.

[para] The pager is only invoked when

[list_begin enumerated]
[enum] Stdout is a terminal, and
[enum] The text does not fit into the height of the terminal, and
[enum] a pager application could be found.

[para] If any of the above conditions fail the text is simply printed.

[para] When the command comes to the third condition above it will look
for the pager specified in the environment variable [const PAGER] first,
and then [const less] and [const more], in this order.

[list_begin arguments]
[arg_def string text]
The text to print or page.

[para] The result of the command is the empty string.

[include parts/]