Documentation ¶
Overview ¶
Package meta contains intermediate types and utilities used to parse a Go AST and generate code to implement a cliche CLI.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArgSpec ¶
type ArgSpec struct { // Start index, inclusive. Start int // End index, exclusive. A negative value indicates that all remaining // arguments beginning with Start should be consumed. End int }
ArgSpec describes parsed positional arguments as defined in a facile struct tag.
type Command ¶
type Command struct { // Name of the command to be generated. This defaults to the name of the // package, unless overridden. Name string // Package name from which the Command is sourced. Package string // Type name of the Command implementation. Type string // Help output for the Command. This will be displayed along with usage // information on the command line. By default, sourced from doc comment for // the package in which the wrapped Command will live. Help string // Description of the command. Should be short and human readable. By // default, sourced from the doc comment on the wrapped Command type. Description string // Inputs describe the handling of struct fields on the wrapped Command // implementation as inputs on the command line. The inputs are derived from // struct tags, when set. Inputs []CommandInput // contains filtered or unexported fields }
Command compiles details about how a type should be wrapped for cliche from the AST describing it. This type is used to execute a Go template, to generate the resulting Go source file.
type CommandInput ¶
CommandInput contains details about how a Command's inputs should be mapped to the struct members of the implementing type.
type FlagSpec ¶
FlagSpec describes parsed flags as defined in a facile struct tag.
type Tag ¶
type Tag string
Tag as on members of a struct which will be used to define cliche command inputs.