Documentation ¶
Overview ¶
Package parser parses fpm help output into a usable object model.
Index ¶
Constants ¶
View Source
const PluginPrefix = "PLUGIN_"
PluginPrefix is the prefix drone will add to all options passed into the plugin as environment variables.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ParsedFlag ¶
type ParsedFlag struct { // Option is the command line option for fpm. Option string // EnvVar is the environment variable that drone will use to inject the variable into the container. EnvVar string // HasInput is used to determine if the flag contains input or not. HasInput bool }
ParsedFlag contains a flag parsed from the fpm help output.
type ParsedOptionLine ¶
type ParsedOptionLine struct { // Options is a comma separated list of potential options for the flag in question. Options string // Docs is the doc string for the command line flag. Docs string // HasInput is used to determine if the flag contains input or not. HasInput bool }
ParsedOptionLine is a structured representation of an option line for fpm's help message.
type Parser ¶
type Parser struct { // Lines is a slice of strings containing the fpm help output. Lines []string }
Parser is a struct containing the lines to parse.
func NewInitialisedParser ¶
NewInitialisedParser creates a new parser populated with output from fpm -h.
func (*Parser) Parse ¶
func (p *Parser) Parse() ([]ParsedFlag, error)
Parse will return the output of fpm -h as a slice of structured flag objects.
Click to show internal directories.
Click to hide internal directories.