gitlink-cli/cmd/cmdutil/globals.go

23 lines
538 B
Go
Raw 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
)
// 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")