Documentation ¶
Overview ¶
Package skapt provides a tiny interface to create and manage your command line applications
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct { // Name of the command line application Name string // Usage is the usage of the command line Usage string // Description holds the description of the command line Description string // Version is the version of the application Version string // Flags holds list of the root command Flags flag.Flags // NArgs minim required value args NArgs int // Handler is the root main handler Handler func(ctx *Context) error // Stdout place to write information that the user // needs to know Stdout io.Writer // Stderr place where all error messages should be written Stderr io.Writer }
Application will hold all the information for creating and parsing the command line
func (Application) Exec ¶
func (a Application) Exec(args []string) (err error)
Exec executes the command line based on the args provided
type Context ¶
type Context struct { // Flags contains the parsed flags flag.Flags // Args additional command line arguments Args []string // Stdout writer to stdout Stdout io.Writer // Stdout writer to stderr Stderr io.Writer }
Context holds context specific information for the current running handler
Directories ¶
Path | Synopsis |
---|---|
Package argument provides small set of types to parse and interpret command line arguments Package argument provides small set of types to parse and interpret command line arguments
|
Package argument provides small set of types to parse and interpret command line arguments Package argument provides small set of types to parse and interpret command line arguments |
Package flag provides types and functions to create and manage your command line applications Package flag provides types and functions to create and manage your command line applications
|
Package flag provides types and functions to create and manage your command line applications Package flag provides types and functions to create and manage your command line applications |
Click to show internal directories.
Click to hide internal directories.