Documentation
¶
Index ¶
- Variables
- func RegisterCommand(registerFunc func(*flags.Parser, *config.GlobalOptions))
- type AnalyzeCommand
- func (cmd *AnalyzeCommand) Clone() parser.Task
- func (cmd *AnalyzeCommand) Close()
- func (cmd *AnalyzeCommand) Execute(args []string) error
- func (cmd *AnalyzeCommand) Name() string
- func (cmd *AnalyzeCommand) ReportResults() error
- func (cmd *AnalyzeCommand) SetProjectDir(dir string)
- func (cmd *AnalyzeCommand) Visit(file *ast.File, fset *token.FileSet, typeInfo *types.Info)
- type ParserCommand
- type StatisticsCommand
- func (cmd *StatisticsCommand) Clone() parser.Task
- func (cmd *StatisticsCommand) Close()
- func (cmd *StatisticsCommand) Execute(args []string) error
- func (cmd *StatisticsCommand) Name() string
- func (cmd *StatisticsCommand) ReportResults() error
- func (cmd *StatisticsCommand) SetProjectDir(dir string)
- func (cmd *StatisticsCommand) Visit(file *ast.File, fset *token.FileSet, typeInfo *types.Info)
Constants ¶
This section is empty.
Variables ¶
var CommandRegistry []func(*flags.Parser, *config.GlobalOptions)
Stores anonymous functions used to register each command with the flag parser, which are all called by the `main` function. Should only be modified by calling `RegisterCommand` in the `init` function of each command implementation.
Functions ¶
func RegisterCommand ¶
func RegisterCommand(registerFunc func(*flags.Parser, *config.GlobalOptions))
Prepares a command for use by saving the function that registers it in the flag parser.
Types ¶
type AnalyzeCommand ¶
type AnalyzeCommand struct {
// contains filtered or unexported fields
}
Implementation of both the Parser Task interface and the Flags package's Commander interface. Stores input flags for the task, as well as fields representing the data to be collected.
func NewAnalyzeCommand ¶
func NewAnalyzeCommand(globals *config.GlobalOptions) *AnalyzeCommand
Create a new instance of the AnalyzeCommand using a reference to the global options.
func (*AnalyzeCommand) Clone ¶
func (cmd *AnalyzeCommand) Clone() parser.Task
Create a new instance of the AnalyzeCommand with the same initial state and flags, COPYING `globals`. Note that `output` is shared by reference, so the same `FileWriter` instance is shared by all cloned instances.
func (*AnalyzeCommand) Close ¶
func (cmd *AnalyzeCommand) Close()
func (*AnalyzeCommand) Execute ¶
func (cmd *AnalyzeCommand) Execute(args []string) error
Validate the values of this Command's flags, then run the task itself THIS SHOULD ONLY BE CALLED ONCE PER PROGRAM EXECUTION.
func (*AnalyzeCommand) Name ¶
func (cmd *AnalyzeCommand) Name() string
func (*AnalyzeCommand) ReportResults ¶
func (cmd *AnalyzeCommand) ReportResults() error
func (*AnalyzeCommand) SetProjectDir ¶
func (cmd *AnalyzeCommand) SetProjectDir(dir string)
Set the project directory for this task.
type ParserCommand ¶
Represents an application command that can be executed as a task by the parser. This is a combination of both the Parser's Task interface and the Flags package's Commander interface. Stores input flags for the task, as well as fields representing the data to be collected.
Implementations of this interface should include fields for global and and command-specific options, as well as fields for any data that needs to be collected during the execution of the task. Implementations should use the `init` function to register themselves via the command registry.
type StatisticsCommand ¶
type StatisticsCommand struct {
// contains filtered or unexported fields
}
Implementation of both the Parser Task interface and the Flags package's Commander interface. Stores input flags for the task, as well as fields representing the data to be collected.
func NewStatisticsCommand ¶
func NewStatisticsCommand(globals *config.GlobalOptions) *StatisticsCommand
Create a new instance of the StatisticsCommand using a reference to the global options.
func (*StatisticsCommand) Clone ¶
func (cmd *StatisticsCommand) Clone() parser.Task
Create a new instance of the StatisticsCommand with the same initial state and flags, COPYING `globals`. Note that `output` is shared by reference, so the same `FileWriter` instance is shared by all cloned instances.
func (*StatisticsCommand) Close ¶
func (cmd *StatisticsCommand) Close()
func (*StatisticsCommand) Execute ¶
func (cmd *StatisticsCommand) Execute(args []string) error
Validate the values of this Command's flags, then run the task itself. THIS SHOULD ONLY BE CALLED ONCE PER PROGRAM EXECUTION.
func (*StatisticsCommand) Name ¶
func (cmd *StatisticsCommand) Name() string
func (*StatisticsCommand) ReportResults ¶
func (cmd *StatisticsCommand) ReportResults() error
func (*StatisticsCommand) SetProjectDir ¶
func (cmd *StatisticsCommand) SetProjectDir(dir string)
Set the project directory for this task.