manpage

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 7, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package manpage provides roff man page generation for cmdguard CLIs. It is an optional module — import it only when you need man page output, to keep your dependency tree lean.

Usage:

import (
    v3 "github.com/larsartmann/cmdguard/v3/pkg/cmdguard/v3"
    "github.com/larsartmann/cmdguard/manpage"
)

content, _ := manpage.Generate(cli, 1)
fmt.Println(content)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate[T any](cli *v3.CLI[T], section uint) (string, error)

Generate produces a roff man page for the CLI. Section is typically 1 for user commands or 8 for system commands.

func GenerateCommand

func GenerateCommand[T any](cli *v3.CLI[T]) (*cobra.Command, error)

GenerateCommand creates a cobra command that generates man pages. Add this as a subcommand to provide `myapp man` functionality.

func NewManPage

func NewManPage(section uint, cmd *cobra.Command) (*mango.ManPage, error)

NewManPage creates a mango man page from a cobra command. Useful for custom man page generation pipelines.

func Write

func Write[T any](cli *v3.CLI[T], w io.Writer, section uint) error

Write generates and writes a roff man page to the given writer.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL