ops

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2026 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package ops contains shared operational helpers for CLI actions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfirmDelete

func ConfirmDelete(in io.Reader, out io.Writer, count int, hard bool) (bool, error)

ConfirmDelete asks the user to confirm delete action.

func ConfirmRestore

func ConfirmRestore(in io.Reader, out io.Writer, count int) (bool, error)

ConfirmRestore asks the user to confirm restore action.

func IsInteractiveReader

func IsInteractiveReader(r io.Reader) bool

IsInteractiveReader checks whether reader is a terminal-like file descriptor.

Types

type PreviewMode

type PreviewMode string

PreviewMode controls pre-action preview behavior.

const (
	PreviewFull   PreviewMode = "full"
	PreviewSample PreviewMode = "sample"
	PreviewNone   PreviewMode = "none"
)

func ParsePreviewMode

func ParsePreviewMode(v string) (PreviewMode, error)

ParsePreviewMode parses a preview mode string.

Jump to

Keyboard shortcuts

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