cli

package
v1.14.4 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: MPL-2.0 Imports: 7 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cli provides utilities for CLI tools.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fatalf

func Fatalf(message string, args ...any)

Fatalf prints formatted message to stderr and aborts execution.

func Should

func Should(err error)

Should panics if err != nil

Should is useful when error should never happen in customer environment, it can only be development error.

func Warning

func Warning(message string, args ...any)

Warning prints formatted message to stderr.

func WithContextC added in v1.14.0

func WithContextC(ctx context.Context, f func(context.Context) (*cobra.Command, error)) (*cobra.Command, error)

WithContextC wraps function call to provide a context cancellable with SIGTERM (Ctrl^C) or SIGINT. Returns the resolved command and error from the function call.

Types

This section is empty.

Jump to

Keyboard shortcuts

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