input

package
v0.44.0 Latest Latest
Warning

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

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

Documentation

Overview

Package input provides helpers for reading flag values from stdin and files.

Index

Constants

This section is empty.

Variables

View Source
var ErrStdinAlreadyUsed = errors.New("stdin already used")

ErrStdinAlreadyUsed is returned when multiple flags try to consume stdin.

Functions

func ExpandFlagValues

func ExpandFlagValues(values []string, stdinUsed bool) ([]string, bool)

ExpandFlagValues expands flag values that use - (stdin) or @file syntax. Returns the expanded values and whether stdin was consumed.

func ReadLinesFromReader

func ReadLinesFromReader(r io.Reader) []string

ReadLinesFromReader reads non-empty lines from a reader.

func ReadText added in v0.44.0

func ReadText(source string, stdin io.Reader, stdinUsed bool) (string, bool, error)

ReadText preserves the full contents of a file or stdin as a single block. The special source "-" reads from stdin exactly once.

Types

This section is empty.

Jump to

Keyboard shortcuts

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