command

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: AGPL-3.0 Imports: 3 Imported by: 1

README

yup.cat

A pure Go implementation of the cat command that adheres to the yup.sh Command interface.

Features

  • Concatenate and display files
  • Number output lines
  • Show line endings
  • Show tab characters
  • Squeeze multiple blank lines
  • Strongly typed flag system

Usage

import "github.com/yupsh/yup.cat"

// Basic usage
cmd := cat.Cat("file1.txt", "file2.txt")

// With flags
cmd := cat.Cat("file.txt", cat.NumberLines{}, cat.ShowEnds{})

// Execute
err := cmd.Execute(ctx, input, output, stderr)

Flags

  • NumberLines{} - Number all output lines (-n)
  • ShowEnds{} - Display $ at end of each line (-E)
  • ShowTabs{} - Display TAB characters as ^I (-T)
  • SqueezeBlank{} - Suppress repeated empty output lines (-s)

Documentation

Index

Constants

View Source
const (
	TrimSpaces   trimTrailingSpacesFlag = true
	NoTrimSpaces trimTrailingSpacesFlag = false
)
View Source
const (
	NumberLines   numberLinesFlag = true
	NoNumberLines numberLinesFlag = false
)
View Source
const (
	ShowEnds   showEndsFlag = true
	NoShowEnds showEndsFlag = false
)
View Source
const (
	ShowTabs   showTabsFlag = true
	NoShowTabs showTabsFlag = false
)
View Source
const (
	SqueezeBlank   squeezeBlankFlag = true
	NoSqueezeBlank squeezeBlankFlag = false
)

Variables

This section is empty.

Functions

func Cat

func Cat(parameters ...any) yup.Command

Types

This section is empty.

Jump to

Keyboard shortcuts

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