cmdutils

package module
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: Apache-2.0 Imports: 6 Imported by: 25

README

CMD Utils

A CMD utility designed for use within Loophole Labs projects

Discord Go Version Go Reference

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/loopholelabs/cmdutils. For more contribution information check out the contribution guide.

License

The CMD Utils project is available as open source under the terms of the Apache License, Version 2.0.

Code of Conduct

Everyone interacting in the CMD Utils project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the CNCF Code of Conduct.

Project Managed By:

Documentation

Index

Constants

View Source
const ActionRequestedExitCode = 1
View Source
const FatalErrExitCode = 2

Variables

This section is empty.

Functions

func RequiredArgs

func RequiredArgs(reqArgs ...string) cobra.PositionalArgs

RequiredArgs - required arguments are not available.

Types

type Error

type Error struct {
	Msg string
	// Status
	ExitCode int
}

Error can be used by a command to change the exit status of the CLI.

func (*Error) Error

func (e *Error) Error() string

type Helper

type Helper[T config.Config] struct {
	// Config contains globally sourced configuration
	Config T

	// Printer is used to print output of a command to stdout.
	Printer *printer.Printer

	// Logger is used to provide structured logging for a command.
	Logger types.Logger
	// contains filtered or unexported fields
}

Helper is passed to every single command and is used by individual subcommands.

func (*Helper[T]) Debug

func (h *Helper[T]) Debug() bool

func (*Helper[T]) SetDebug

func (h *Helper[T]) SetDebug(debug *bool)

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

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