Documentation ¶
Index ¶
- Variables
- func Err() io.Writer
- func FlagErrorFunc() func(*cobra.Command, error) error
- func GlobalNormalizationFunc() func(f *pflag.FlagSet, name string) pflag.NormalizedName
- func HelpFunc() func(*cobra.Command, []string)
- func HelpTemplate() string
- func PcliOut() io.Writer
- func Progress() *pterm.ProgressbarPrinter
- func SetRepo(repo string) error
- func SetRootCmd(cmd *cobra.Command)
- func Setup()
- func Spinner() *pterm.SpinnerPrinter
- func Table() *pterm.TablePrinter
- func UsageFunc() func(*cobra.Command) error
- func UsageTemplate() string
- func VersionTemplate() string
- type MarkdownDocument
Constants ¶
This section is empty.
Variables ¶
var ( Paragraph = pterm.ParagraphPrinter{ MaxWidth: 70, } // Info returns a PrefixPrinter, which can be used to print text with an "info" Prefix. Info = pterm.PrefixPrinter{ MessageStyle: infoMessageStyle, Prefix: infoPrefix, } // Info returns a PrefixPrinter, which can be used to print text with an "info" Prefix. Verbose = pterm.PrefixPrinter{ MessageStyle: verboseMessageStyle, Prefix: verbosePrefix, } // Warning returns a PrefixPrinter, which can be used to print text with a "warning" Prefix. Warning = pterm.PrefixPrinter{ MessageStyle: warningMessageStyle, Prefix: warningPrefix, } // Success returns a PrefixPrinter, which can be used to print text with a "success" Prefix. Success = pterm.PrefixPrinter{ MessageStyle: successMessageStyle, Prefix: successPrefix, } // Error returns a PrefixPrinter, which can be used to print text with an "error" Prefix. Error = pterm.PrefixPrinter{ MessageStyle: errorMessageStyle, Prefix: errorPrefix, } // Fatal returns a PrefixPrinter, which can be used to print text with an "fatal" Prefix. // NOTICE: Fatal terminates the application immediately! Fatal = pterm.PrefixPrinter{ MessageStyle: fatalMessageStyle, Prefix: fatalPrefix, Fatal: true, } // Debug Prints debug messages. By default it will only print if PrintDebugMessages is true. // You can change PrintDebugMessages with EnableDebugMessages and DisableDebugMessages, or by setting the variable itself. Debug = pterm.PrefixPrinter{ MessageStyle: debugMessageStyle, Prefix: debugPrefix, Debugger: true, } // Description returns a PrefixPrinter, which can be used to print text with a "description" Prefix. Description = pterm.PrefixPrinter{ MessageStyle: descriptionMessageStyle, Prefix: descriptionPrefix, } )
var AppInfo = meta{}
var DescriptionSectionPrinter = pterm.DefaultSection.WithLevel(2).Sprint
var DetailSectionPrinter = pterm.DefaultSection.WithLevel(3).Sprint
var HelpSectionPrinter = pterm.DefaultSection.WithLevel(2).Sprint
HelpSectionPrinter is used to print the different sections in the CLIs help output. You can overwrite it with any Sprint function.
var ParagraphPrinter = pterm.DefaultParagraph.Sprint
var TitleSectionPrinter = pterm.DefaultSection.WithLevel(1).Sprint
Functions ¶
func FlagErrorFunc ¶
FlagErrorFunc is a drop in replacement for spf13/cobra `FlagErrorFunc`
func GlobalNormalizationFunc ¶
func GlobalNormalizationFunc() func(f *pflag.FlagSet, name string) pflag.NormalizedName
GlobalNormalizationFunc is a drop in replacement for spf13/cobra `GlobalNormalizationFunc`
func HelpTemplate ¶
func HelpTemplate() string
HelpTemplate is a drop in replacement for spf13/cobra `HelpTemplate`
func Progress ¶
func Progress() *pterm.ProgressbarPrinter
func Spinner ¶
func Spinner() *pterm.SpinnerPrinter
func Table ¶
func Table() *pterm.TablePrinter
func UsageTemplate ¶
func UsageTemplate() string
UsageTemplate is a drop in replacement for spf13/cobra `UsageTemplate`
func VersionTemplate ¶
func VersionTemplate() string
VersionTemplate is a drop in replacement for spf13/cobra `VersionTemplate`
Types ¶
type MarkdownDocument ¶
MarkdownDocument contains the command and it's markdown documentation.
func GenerateMarkdownDoc ¶
func GenerateMarkdownDoc(command *cobra.Command) (markdown MarkdownDocument)
GenerateMarkdownDoc walks trough every subcommand of rootCmd and creates a documentation written in Markdown for it.