gitlink-cli/cmd/cmdutil/globals.go

26 lines
735 B
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package cmdutil
import "errors"
// Global flags shared across all commands.
var (
Owner string
Repo string
Format string
Debug bool
NoTruncate bool // disable 60-char truncation in table output
Columns string // comma-separated column names for table output
NoColor bool // disable ANSI color output
)
// ErrSilent 是 sentinel error表示错误已经被上层处理过如已按 envelope 格式
// 输出到 stdout调用方cmd.Execute只需返回非零退出码不要再把消息
// 打印到 stderr。
//
// 使用方式:
//
// if TryPrintError(err, format) {
// return cmdutil.ErrSilent
// }
var ErrSilent = errors.New("silent error: already reported via envelope")