patterns

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package patterns provides reusable patterns for pdf-cli commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StdioHandler

type StdioHandler struct {
	InputArg       string
	ExplicitOutput string
	ToStdout       bool
	DefaultSuffix  string
	Operation      string
	// contains filtered or unexported fields
}

StdioHandler manages stdin/stdout for commands that support pipelines.

func (*StdioHandler) Cleanup

func (h *StdioHandler) Cleanup()

Cleanup releases all resources. Safe to call multiple times.

func (*StdioHandler) Finalize

func (h *StdioHandler) Finalize() error

Finalize writes output to stdout if needed. Call this after the operation succeeds.

func (*StdioHandler) InputPath

func (h *StdioHandler) InputPath() string

InputPath returns the resolved input path.

func (*StdioHandler) OutputPath

func (h *StdioHandler) OutputPath() string

OutputPath returns the resolved output path.

func (*StdioHandler) Setup

func (h *StdioHandler) Setup() (input, output string, err error)

Setup prepares input and output paths, handling stdin/stdout as needed. Returns input path, output path, and error. Call Cleanup() when done, regardless of success or failure.

Jump to

Keyboard shortcuts

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