commoncli

package
v1.2.19-prerelease12 Latest Latest
Warning

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

Go to latest
Published: May 9, 2025 License: Apache-2.0 Imports: 6 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExitHandler

func ExitHandler(err error)

ExitHandler converts errors that urfave/cli did not handle into a nicely printed message, and an appropriate os.Exit call to ensure this func never returns from either branch.

This should be used instead of an in-CLI ExitErrHandler, as using that still leaves a dangling `err` return value from *cli.App.Run(), which is awkward in a number of ways.

func Problem

func Problem(msg string, err error) error

Problem returns a typed error that will report this message "nicely" to the user if it exits the CLI app. The message will be used as the top-level "Error: ..." string regardless of where in the error stack it is, and other wrapped errors will be printed line by line beneath it.

Nested Problem messages will nest structurally, like:

Error: msg
Details:
  some error
  some other error
  Error: message
  ErrorDetails:
    more nested errors

Types

This section is empty.

Jump to

Keyboard shortcuts

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