Documentation ¶
Index ¶
- Variables
- func CheckForUpdates() error
- func Err() io.Writer
- func FlagErrorFunc() func(*cobra.Command, error) error
- func GetCiCommand() *cobra.Command
- func GlobalNormalizationFunc() func(f *pflag.FlagSet, name string) pflag.NormalizedName
- func HelpFunc() func(*cobra.Command, []string)
- func HelpTemplate() string
- func PcliOut() io.Writer
- func SetRepo(repo string) error
- func SetRootCmd(cmd *cobra.Command)
- func Setup()
- func UsageFunc() func(*cobra.Command) error
- func UsageTemplate() string
- func VersionTemplate() string
- type MarkdownDocument
Constants ¶
This section is empty.
Variables ¶
var AppInfo = meta{}
var DisableUpdateChecking = false
DisableUpdateChecking automatically checks if a new version of your application is pushed, and notifies the user.
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.
Functions ¶
func CheckForUpdates ¶ added in v0.3.18
func CheckForUpdates() error
CheckForUpdates checks if a new version of your application is pushed, and notifies the user, if DisableUpdateChecking is true.
func FlagErrorFunc ¶ added in v0.1.0
FlagErrorFunc is a drop in replacement for spf13/cobra `FlagErrorFunc`
func GetCiCommand ¶ added in v0.3.2
GetCiCommand returns a custom crafted CI command. This must be used when using https://github.com/pterm/cli-template.
func GlobalNormalizationFunc ¶ added in v0.1.0
func GlobalNormalizationFunc() func(f *pflag.FlagSet, name string) pflag.NormalizedName
GlobalNormalizationFunc is a drop in replacement for spf13/cobra `GlobalNormalizationFunc`
func HelpTemplate ¶ added in v0.1.0
func HelpTemplate() string
HelpTemplate is a drop in replacement for spf13/cobra `HelpTemplate`
func SetRepo ¶ added in v0.4.1
SetRepo must be set to your repository path (eg. pterm/cli-template).
func Setup ¶ added in v0.3.12
func Setup()
Setup replaces some cobra functions with pcli functions for nicer output.
func UsageTemplate ¶ added in v0.1.0
func UsageTemplate() string
UsageTemplate is a drop in replacement for spf13/cobra `UsageTemplate`
func VersionTemplate ¶ added in v0.1.0
func VersionTemplate() string
VersionTemplate is a drop in replacement for spf13/cobra `VersionTemplate`
Types ¶
type MarkdownDocument ¶ added in v0.3.0
MarkdownDocument contains the command and it's markdown documentation.
func GenerateMarkdownDoc ¶ added in v0.3.5
func GenerateMarkdownDoc(command *cobra.Command) (markdown MarkdownDocument)
GenerateMarkdownDoc walks trough every subcommand of rootCmd and creates a documentation written in Markdown for it.