Documentation
¶
Index ¶
- Constants
- Variables
- func UpWhere(initialDir, marker string) (string, error)
- type Command
- func (c *Command) Check(ctx context.Context) (string, error)
- func (c *Command) Execute(ctx context.Context, f *flag.FlagSet, args ...interface{}) subcommands.ExitStatus
- func (c *Command) Name() string
- func (c *Command) SetFlags(f *flag.FlagSet)
- func (c *Command) Synopsis() string
- func (c *Command) Usage() string
- type CommandDefinition
- type ShellCommand
- type ShellValue
Constants ¶
View Source
const DefaultLanguage = "bash"
Variables ¶
View Source
var BuildID string = "unknown"
Functions ¶
Types ¶
type Command ¶
type Command struct { Alias string Group string Help string Definition string RenderCheckCmd func(ctx context.Context) *exec.Cmd SetExecFlags func(f *flag.FlagSet) RenderExecCmd func(ctx context.Context, f *flag.FlagSet, args ...interface{}) (*exec.Cmd, error) }
func ParseCommands ¶
func (*Command) Execute ¶
func (c *Command) Execute(ctx context.Context, f *flag.FlagSet, args ...interface{}) subcommands.ExitStatus
type CommandDefinition ¶
type CommandDefinition struct { InputPath string DeclaretionLineStart int Source []byte Name string HeadingStart int HeadingStop int HelpStart int HelpStop int DeclarationStart int DeclarationStop int Declaration *mdast.FencedCodeBlock }
func ParseCommandDefinitions ¶
func ParseCommandDefinitions(source []byte) ([]CommandDefinition, error)
func (*CommandDefinition) Parse ¶
func (d *CommandDefinition) Parse() (*Command, error)
func (*CommandDefinition) ParseCommand ¶
func (d *CommandDefinition) ParseCommand() string
func (*CommandDefinition) ParseDefinition ¶
func (d *CommandDefinition) ParseDefinition() string
func (*CommandDefinition) ParseHelp ¶
func (d *CommandDefinition) ParseHelp() string
type ShellCommand ¶
type ShellCommand struct { Exports map[string]*ShellValue Locals map[string]*ShellValue LocalDeclarations map[string]*syntax.ParamExp File *syntax.File }
func NewShellCommand ¶
func NewShellCommand(shell string) (*ShellCommand, error)
func (*ShellCommand) Print ¶
func (c *ShellCommand) Print() (string, error)
func (*ShellCommand) Render ¶
func (c *ShellCommand) Render(locals map[string]*ShellValue) (string, error)
type ShellValue ¶
Click to show internal directories.
Click to hide internal directories.