aahframe.work: aahframe.work/console Index | Files

package console

import "aahframe.work/console"

Package console provides a feature to implement CLI commands into your aah application easily and extensible.

Index

Package Files

console.go

func AppHelpTemplate Uses

func AppHelpTemplate(t string)

AppHelpTemplate method sets the custom text/template for application help. Console uses text/template to render templates.

func CommandHelpTemplate Uses

func CommandHelpTemplate(t string)

CommandHelpTemplate method sets the custom text/template for command help. Console uses text/template to render templates.

func HelpFlagDesc Uses

func HelpFlagDesc(desc string)

HelpFlagDesc method customized flag name, desc for HelpFlag.

func ShowAppHelp Uses

func ShowAppHelp(c *Context) error

ShowAppHelp is an action that displays the help.

func ShowAppHelpAndExit Uses

func ShowAppHelpAndExit(c *Context, exitCode int)

ShowAppHelpAndExit - Prints the list of subcommands for the app and exits with exit code.

func ShowCommandHelp Uses

func ShowCommandHelp(c *Context, cmd string) error

ShowCommandHelp prints help for the given command

func ShowCommandHelpAndExit Uses

func ShowCommandHelpAndExit(c *Context, cmd string, code int)

ShowCommandHelpAndExit - exits with code after showing help

func ShowSubcommandHelp Uses

func ShowSubcommandHelp(c *Context) error

ShowSubcommandHelp prints help for the given subcommand.

func ShowVersion Uses

func ShowVersion(c *Context)

ShowVersion prints the version number of the App.

func SubcommandHelpTemplate Uses

func SubcommandHelpTemplate(t string)

SubcommandHelpTemplate method sets the custom text/template for sub-command help. Console uses text/template to render templates.

func VersionFlagDesc Uses

func VersionFlagDesc(desc string)

VersionFlagDesc method customized flag name, desc for VersionFlag.

func VersionPrinter Uses

func VersionPrinter(vp func(*Context))

VersionPrinter method set custom func for version printer.

type Application Uses

type Application = cli.App

Application is the main structure of a console application. It is recommended that an app be created with the func `console.NewApp()`.

func NewApp Uses

func NewApp() *Application

NewApp creates a new console Application with some reasonable defaults for Name, Usage, Version and Action.

type Args Uses

type Args = cli.Args

Args contains apps console arguments

type Author Uses

type Author = cli.Author

Author represents someone who has contributed to a console project.

type BoolFlag Uses

type BoolFlag = cli.BoolFlag

BoolFlag is a flag with type bool

type Command Uses

type Command = cli.Command

Command returns the named command on App. Returns nil if the command does not exist

type CommandsByName Uses

type CommandsByName = cli.CommandsByName

CommandsByName is a sorter interface for commands.

type Context Uses

type Context = cli.Context

Context is a type that is passed through to each Handler action in a console application. Context can be used to retrieve context-specific Args and parsed command-line options.

func NewContext Uses

func NewContext(app *Application, set *flag.FlagSet, parentCtx *Context) *Context

NewContext creates a new context. For use in when invoking an App or Command action.

type Flag Uses

type Flag = cli.Flag

Flag is a common interface related to parsing flags in console. For more advanced flag parsing techniques, it is recommended that this interface be implemented.

type FlagsByName Uses

type FlagsByName = cli.FlagsByName

FlagsByName is a sorter interface for flags.

type Float64Flag Uses

type Float64Flag = cli.Float64Flag

Float64Flag is a flag with type float64

type Int64Flag Uses

type Int64Flag = cli.Int64Flag

Int64Flag is a flag with type int64

type IntFlag Uses

type IntFlag = cli.IntFlag

IntFlag is a flag with type int

type IntSlice Uses

type IntSlice = cli.IntSlice

IntSlice is an opaque type for []int to satisfy flag.Value and flag.

type StringFlag Uses

type StringFlag = cli.StringFlag

StringFlag is a flag with type string

type StringSlice Uses

type StringSlice = cli.StringSlice

StringSlice is an opaque type for []string to satisfy flag.Value and flag.

Package console imports 2 packages (graph) and is imported by 3 packages. Updated 2019-01-02. Refresh now. Tools for package owners.