Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetVersionInfo ¶
func SetVersionInfo(version, commit, date string)
SetVersionInfo sets build-time version info from ldflags.
Types ¶
type RunContext ¶
type RunContext struct {
Client flashdutyClient
Cmd *cobra.Command
Args []string
Writer io.Writer
Printer output.Printer
JSON bool
}
RunContext provides helpers for command execution. It is created by runCommand and passed to the command's handler function.
func (*RunContext) PrintList ¶
PrintList prints items as a table and appends a "Showing N results (page P, total T)." footer.
func (*RunContext) PrintTotal ¶
PrintTotal prints items as a table and appends a "Total: N" footer.
func (*RunContext) WriteResult ¶
func (ctx *RunContext) WriteResult(message string)
WriteResult prints a success message as plain text or JSON.
Click to show internal directories.
Click to hide internal directories.