Documentation ¶
Overview ¶
Package serpent provides a way to combine the shaft framework with github.com/spf13/cobra nicely, providing a dependency injection style monolithc CLI interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CommandContext ¶
CommandContext is the context of the executed command.
type CommandObject ¶
CommandObject is the command object that is executed.
type Executor ¶
Executor is the executor for this command. We usually attach the executor's corresponding methods to cobra.Command's RunE or PreRunE field.
When PreRunE is attached, the command provides dependencies specified in the executor to subcommands under its directory. Actually the execution is not based on the cobra's, and we require the user to ensure at least the path from the executed command to the root command is managed by the serpent.
When RunE is attached, the command collects all previously provided options up to this node and execute them.