GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • --usage
  • Get started
  • Rust
  • Go (development preview)
  • Existing framework integrations
  • Spec
  • CLI
  • v7.4.1
  • Shell completions
  • Scripts
  • Markdown documentation
  • Man pages
  • TypeScript and Python SDKs
  • Compare specs

This view

  • Original page
  • New address

GeezerVison is showing usage.jdx.dev — Generate man pages | --usage

Generate man pages ​

usage generate manpage renders a spec as roff, the format man reads. g and man are the short aliases, and without -o the page goes to stdout:

bash
usage g man -f ./mycli.usage.kdl -o mycli.1

On Linux, pipe the result into man to preview it:

bash
usage g man -f ./mycli.usage.kdl | man -l -

On macOS, generate the file and open it with man ./mycli.1.

Installing ​

Install the page in a directory on the target system's manual search path. For example, on Linux with man-db, install a locally managed page and refresh the index:

bash
usage generate manpage --file ./mycli.usage.kdl --out-file mycli.1
sudo install -Dm644 mycli.1 /usr/local/share/man/man1/mycli.1
sudo mandb
man mycli

Sections ​

The page is section 1, user commands, unless --section says otherwise:

bash
usage g man -f ./myconfig.usage.kdl --section 5 -o myconfig.5
SectionContents
1User commands (default)
5File formats and conventions, such as a page about the config file
7Miscellaneous: overviews and conventions
8System administration commands and daemons

What the page contains ​

The spec's about and long help become NAME and DESCRIPTION, its flags and subcommands become OPTIONS and COMMANDS, and any example nodes become EXAMPLES:

mycli(1)                    General Commands Manual                   mycli(1)

NAME
       mycli - description of your CLI tool

SYNOPSIS
       mycli [OPTIONS] <COMMAND>

DESCRIPTION
       Detailed description of your CLI tool...

OPTIONS
       -h, --help
              Print help information

       -v, --verbose
              Enable verbose output

COMMANDS
       install
              Install a plugin

       list
              List installed plugins

EXAMPLES
       Install a plugin:

           mycli install my-plugin

AUTHOR
       Your Name <[email protected]>
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.