package b0
Software construction and deployment kit
Install
dune-project
Dependency
Authors
Maintainers
Sources
b0-0.0.6.tbz
sha512=e9aa779e66c08fc763019f16d4706f465d16c05d6400b58fbd0313317ef33ddea51952e2b058db28e65f7ddb7012f328c8bf02d8f1da17bb543348541a2587f0
doc/b0.std/B0_pager/index.html
Module B0_pager
Source
Pager interaction.
Paging
The type for pagers.
Source
val find :
?search:B0_std.Cmd.tool_search ->
?cmd:B0_std.Cmd.t ->
no_pager:bool ->
unit ->
(t, string) result
find ~search ~don't
finds a suitable pager. This is (in order):
Ok p
ifno_pager
istrue
or if theTERM
environment variable isdumb
or undefined andcmd
is unspecified. In this casedoes_page p
isfalse
.Ok p
orError _
ifcmd
is specified and according to whetherOs.Cmd.get ?search cmd
succeeds.Ok (Some pager)
ifpager
is a tool invocation parsed from thePAGER
environment variable that can be found viaOs.Cmd.find ?search
.Ok (Some pager)
if eitherless
ormore
can be found (in that order) viaOs.Cmd.find ?search
.Ok None
otherwise.
page_stdout p
setups the program so that if does_page p
is true
, the standard output of the program is redirected to a spawn of of the pager with the following twists:
- If the environment variable
LESS
is undefined in the current environment it is set toLESS=FRX
for the spawn ofcmd
. - A
Stdlib.at_exit
function is installed that flushesB0_std.Fmt.stdout
andStdlib.stdout
, closesUnix.stdout
and waits upon thecmd
spawn termination.
If does_page p
is false
this function has no effect.
page_files p fs
uses pager
to page the files fs
. If does_page p
is:
false
, each of thefs
files is output on stdout, in order, separated by a file separator character (U+001C).true
, the pager's command is withfs
as arguments, unlessfs
is empty in which case this is a nop.
Cli interaction
no_pager ~docs ()
is a --no-pager
command line option to unconditionally request not to use a pager. docs
is the manual section where the option is documented, defaults to Cmdliner.Manpage.s_common_options
.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page