cmdutil

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package cmdutil is expected to be used for running potentially destructive commands with a user confirmation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, cmds []*exec.Cmd, opts *RunOpts) error

func RunWithCobra

func RunWithCobra(ctx context.Context, cmds []*exec.Cmd, cobraCmd *cobra.Command) error

Types

type RunOpts

type RunOpts struct {
	Confirm bool
	Stdin   io.Reader
	Stdout  io.Writer
	Stderr  io.Writer
}

func RunOptsFromCobra

func RunOptsFromCobra(cmd *cobra.Command) (*RunOpts, error)

func RunOptsFromCobraNoStdin

func RunOptsFromCobraNoStdin(cmd *cobra.Command) (*RunOpts, error)

RunOptsFromCobraNoStdin is similar to RunOptsFromCobra but for non-destructive commands.

Jump to

Keyboard shortcuts

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