Documentation ¶
Index ¶
- Constants
- func AddFlagsEntry(cmd *cobra.Command, s *set.Entry)
- func AddFlagsFileSave(cmd *cobra.Command, s *set.FileSave)
- func AddFlagsFileSelection(cmd *cobra.Command, s *set.FileSelection)
- func AddFlagsMessage(cmd *cobra.Command, s *set.Message)
- func AddFlagsNotification(cmd *cobra.Command, s *set.Notification)
- func AddFlagsOptions(cmd *cobra.Command, s *set.Options)
- func DefaultExtraButtonCallback(g *res.General) func() error
- func HandleGeneralJSONResult(ctx *CmdContext, err error) error
- func HandleGeneralResult(ctx *CmdContext, g *res.General, err error, okCallback func() error, ...) error
- func HandleJSONResult(ctx *CmdContext, r res.JSONResult, g *res.General, err error) error
- func OutputArray(l []string, sep string) (err error)
- func OutputIndexArray(l []uint, sep string) error
- func OutputString(s string) (err error)
- type CmdContext
- type ExitCode
Constants ¶
View Source
const (
// ExitCodeCanceled is the exit code if the user cancled or closed the dialog.
ExitCodeCanceled = 1
)
View Source
const (
LineBreak = "\n"
)
Variables ¶
This section is empty.
Functions ¶
func AddFlagsFileSelection ¶
func AddFlagsFileSelection(cmd *cobra.Command, s *set.FileSelection)
func AddFlagsNotification ¶
func AddFlagsNotification(cmd *cobra.Command, s *set.Notification)
func DefaultExtraButtonCallback ¶
DefaultExtraButtonCallback is the default extra button callback.
func HandleGeneralJSONResult ¶
func HandleGeneralJSONResult(ctx *CmdContext, err error) error
HandleGeneralJSONResult handles the output of the general result.
func HandleGeneralResult ¶
func HandleGeneralResult(ctx *CmdContext, g *res.General, err error, okCallback func() error, cancelCallback func() error, extraCallback func() error) error
HandleGeneralResult handles output of general result on stdout.
func HandleJSONResult ¶
func HandleJSONResult(ctx *CmdContext, r res.JSONResult, g *res.General, err error) error
HandleJSONResult handles the output of the result in form of JSON.
func OutputArray ¶
OutputArray outputs a string array to std output with an appended line break.
func OutputIndexArray ¶
OutputArray outputs an index array to std output.
Types ¶
type CmdContext ¶
type CmdContext struct { // Exit code of the dialog app. ExitCode ExitCode // Report as JSON ReportAsJSON bool // Log context. Log cm.ILogContext }
Click to show internal directories.
Click to hide internal directories.