Skip to content

moulti manpage

Like moulti diff, moulti manpage offers two subcommands (parse and run) that make it possible to load and read man pages in Moulti. Specifically, it creates:

  • one divider widget for the header (title and manual section)
  • one step widget for each section of the man page
  • one divider widget for the footer (e.g. date and version)

                                              man bash                                               ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ BASH(1)                            General Commands Manual                           BASH(1) ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ ▼ NAME     bash - GNU Bourne-Again SHell ▼ SYNOPSIS bash [options] [command_string | file] ▼ COPYRIGHT     Bash is Copyright (C) 1989-2022 by the Free Software Foundation, Inc. ▼ DESCRIPTION Bash  is  an  sh-compatible  command language interpreter that executes commands read     from the standard input or from a file.  Bash also incorporates useful features  from     the Korn and C shells (ksh  and  csh). Bash is intended to be a conformant implementation of the Shell and Utilities portion▃▃     of the IEEE POSIX specification (IEEE Standard 1003.1).  Bash can be configured to be     POSIX-conformant by default. ▶ OPTIONS ▶ ARGUMENTS ▶ INVOCATION ▶ DEFINITIONS ▶ RESERVED WORDS ▶ SHELL GRAMMAR ▶ COMMENTS ▶ QUOTING ▶ PARAMETERS ▶ EXPANSION ▶ REDIRECTION  l  Lock scroll  s  Save  z  Console   x   Expand all  o  Collapse all  d  Light  h   Help   q  Quit 

How to use it?

For the sake of convenience, Moulti provides moulti-man, a wrapper around man:

# Read the man page for the bash shell:
moulti-man bash
# Read the man page for the open() syscall:
moulti-man 2 open

Under the hood, this wrapper essentially runs:

moulti run -- moulti manpage run -- man bash

i.e. moulti run starts a new Moulti instance then runs moulti manpage run -- man bash, which runs man bash, captures its output and turns it into a sequence of divider and step widgets.

Encoding

By default, moulti manpage expects man to output UTF-8 text; this encoding can be changed by setting the environment variable MOULTI_MANPAGE_ENCODING, e.g. export MOULTI_MANPAGE_ENCODING=iso-8859-1.

Title

By default, moulti manpage changes the title of the Moulti instance so that it reflects the man command (e.g. man bash). Set the environment variable MOULTI_MANPAGE_NO_TITLE to any value to prevent that.

Generated widgets

By default, moulti manpage acts like a blackbox: it reads the man page, connects to the adequate Moulti instance, adds dividers and steps, then exits. That makes it hard (albeit not impossible) to determine the number and ids of dividers and steps added by moulti manpage.

If the environment variable MOULTI_MANPAGE_VERBOSE is set to any non-empty value, moulti manpage outputs the type and id of each generated widget to stdout. Example:

$ MOULTI_MANPAGE_VERBOSE=y moulti manpage run -- man true
divider manpage_766397_1
step manpage_766397_2
step manpage_766397_3
step manpage_766397_4
step manpage_766397_5
step manpage_766397_6
step manpage_766397_7
step manpage_766397_8
divider manpage_766397_9

That makes it possible to perform simple update/delete operations on these widgets.

What next?

Head to Documentation for more information on various topics.