capture

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Capturer

type Capturer struct {
	// contains filtered or unexported fields
}

Capturer recursively captures help output from CLI tools.

func New

func New(logger *logrus.Logger) *Capturer

New creates a new Capturer instance.

func (*Capturer) Capture

func (c *Capturer) Capture(binaryPath, outputPath string, opts Options) error

Capture crawls a binary's help output and generates documentation.

type CommandNode

type CommandNode struct {
	Name        string
	FullName    string // e.g. "nb concept new"
	HelpOutput  string // Plain text (ANSI stripped)
	RawOutput   string // Raw output with ANSI codes
	SubCommands []*CommandNode
}

CommandNode represents a command and its subcommands.

type Format

type Format string

Format specifies the output format.

const (
	FormatMarkdown Format = "markdown"
	FormatHTML     Format = "html"
)

type Options

type Options struct {
	MaxDepth        int
	Format          Format
	SubcommandOrder []string // Priority order for subcommands (rest alphabetical)
}

Options configures the capture behavior.

Jump to

Keyboard shortcuts

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