cmdutil

package
v0.0.0-...-e237f2d Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommandMKVMerge    string = "mkvmerge"
	CommandMKVPropEdit string = "mkvpropedit"
	CommandRsync       string = "rsync"
	CommandSubsync     string = "subsync"
)

Variables

View Source
var (
	// Whether debug mode is enabled or not.
	DebugMode bool

	// Maximum number of concurrent goroutines.
	MaxConcurrentGoroutines int

	// All possible --output values.
	OutputFormats = []string{"json", "text", "yaml"}

	// Selected or default --output value.
	OutputFormat string
)

Functions

func AddOutputFlag

func AddOutputFlag(cmd *cobra.Command)

Adds --output to given command.

func CallParentPersistentPreRun

func CallParentPersistentPreRun(cmd *cobra.Command, args []string)

Runs ParentPersistentPreRun if defined.

func CallParentPersistentPreRunE

func CallParentPersistentPreRunE(cmd *cobra.Command, args []string) error

Runs ParentPersistentPreRunE if defined.

func GetMKVMergeProgress

func GetMKVMergeProgress(str string) (percentage int, err error)

func GetRsyncProgress

func GetRsyncProgress(str string) (percentage int, err error)

func GetSubsyncProgress

func GetSubsyncProgress(str string) (percentage int, points int, err error)

func NewListWriter

func NewListWriter() list.Writer

func NewProgressWriter

func NewProgressWriter(out io.Writer, expectedLength int) progress.Writer

func OnlyValidOutputs

func OnlyValidOutputs() error

Checks that value passed to --output is valid.

Types

type Command

type Command[T ~string] interface {
	Command() *cobra.Command
	Kind() T
	Out() io.Writer
}

Jump to

Keyboard shortcuts

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