Documentation ¶
Index ¶
- Variables
- func CloseAll(files map[string]io.ReadCloser)
- func CreateMaker(execOpt ToolchainExecOpt, goals []string) (*makex.Maker, *makex.Makefile, error)
- func Main()
- func OpenInputFiles(extraArgs []string) map[string]io.ReadCloser
- func PrintJSON(v interface{}, prefix string)
- func SetOptionDefaultValue(g *flags.Group, longName string, defaultVal ...string)
- func SetRepoOptDefaults(c *flags.Command)
- func SourceUnitMatchesArgs(specified []string, u *unit.SourceUnit) bool
- type APICmd
- type APIDescribeCmd
- type BuildCacheOpt
- type ConfigCmd
- type Directory
- type DoAllCmd
- type InfoCmd
- type MakeCmd
- type NormalizeGraphDataCmd
- type Repo
- type Subcommand
- type TestCmd
- type ToolCmd
- type ToolName
- type ToolchainAddCmd
- type ToolchainBuildCmd
- type ToolchainCmd
- type ToolchainExecOpt
- type ToolchainGetCmd
- type ToolchainListCmd
- type ToolchainListToolsCmd
- type ToolchainPath
- type UnitAuthorshipCmd
- type UnitBlameCmd
- type UnitsCmd
Constants ¶
This section is empty.
Variables ¶
View Source
var CLI = flags.NewNamedParser("src", flags.Default)
View Source
var GlobalOpt struct { Verbose bool `short:"v" description:"show verbose output"` }
GlobalOpt contains global options.
View Source
var Subcommands = []Subcommand{}
Functions ¶
func CloseAll ¶
func CloseAll(files map[string]io.ReadCloser)
func CreateMaker ¶ added in v0.0.9
CreateMaker creates a Makefile and a Maker. The cwd should be the root of the tree you want to make (due to some probably unnecessary assumptions that CreateMaker makes).
func OpenInputFiles ¶
func OpenInputFiles(extraArgs []string) map[string]io.ReadCloser
func SetOptionDefaultValue ¶
func SetRepoOptDefaults ¶
func SetRepoOptDefaults(c *flags.Command)
func SourceUnitMatchesArgs ¶
func SourceUnitMatchesArgs(specified []string, u *unit.SourceUnit) bool
Types ¶
type APIDescribeCmd ¶
type APIDescribeCmd struct { File string `long:"file" required:"yes" value-name:"FILE"` StartByte int `long:"start-byte" required:"yes" value-name:"BYTE"` Examples bool `long:"examples" describe:"show examples from Sourcegraph.com"` }
func (*APIDescribeCmd) Execute ¶
func (c *APIDescribeCmd) Execute(args []string) error
type BuildCacheOpt ¶
type ConfigCmd ¶
type ConfigCmd struct { config.Options ToolchainExecOpt `group:"execution"` BuildCacheOpt `group:"build cache"` Output struct { Output string `short:"o" long:"output" description:"output format" default:"text" value-name:"text|json"` } `group:"output"` Args struct { Dir Directory `name:"DIR" default:"." description:"root directory of tree to configure"` } `positional-args:"yes"` }
type Directory ¶
type Directory string
Directory is flags.Completer that provides directory name completion.
TODO(sqs): this is annoying. it only completes the dir name and doesn't let you keep typing the arg.
type DoAllCmd ¶
type DoAllCmd struct { config.Options ToolchainExecOpt `group:"execution"` BuildCacheOpt `group:"build cache"` Dir Directory `short:"C" long:"directory" description:"change to DIR before doing anything" value-name:"DIR"` }
type MakeCmd ¶
type MakeCmd struct { config.Options ToolchainExecOpt `group:"execution"` BuildCacheOpt `group:"build cache"` PrintMakefile bool `short:"p" long:"print" description:"print planned Makefile and exit"` DryRun bool `short:"n" long:"dry-run" description:"print what would be done and exit"` Dir Directory `short:"C" long:"directory" description:"change to DIR before doing anything" value-name:"DIR"` Args struct { Goals []string `name:"GOALS..." description:"Makefile targets to build (default: all)"` } `positional-args:"yes"` }
type NormalizeGraphDataCmd ¶
type NormalizeGraphDataCmd struct{}
func (*NormalizeGraphDataCmd) Execute ¶
func (c *NormalizeGraphDataCmd) Execute(args []string) error
type Repo ¶
type Subcommand ¶
type TestCmd ¶
type TestCmd struct { GenerateExpected bool `long:"gen" description:"(re)generate expected output for all test cases and exit"` CheckInternalTargets bool `long:"check-internal-targets" description:"also produce and check internal command outputs (ex: blame, authorship)"` ToolchainExecOpt Args struct { Trees []Directory `name:"TREES" description:"trees to treat as test cases"` } `positional-args:"yes"` }
type ToolCmd ¶
type ToolCmd struct { ToolchainExecOpt Args struct { Toolchain ToolchainPath `name:"TOOLCHAIN" description:"toolchain path of the toolchain to run"` Tool ToolName `name:"TOOL" description:"tool subcommand name to run (in TOOLCHAIN)"` ToolArgs []string `name:"ARGS" description:"args to pass to TOOL"` } `positional-args:"yes" required:"yes"` }
type ToolchainAddCmd ¶ added in v0.0.3
type ToolchainAddCmd struct { Dir string `long:"dir" description:"directory containing toolchain to add" value-name:"DIR"` Args struct { ToolchainPath string `name:"TOOLCHAIN" default:"." description:"toolchain path to use for toolchain directory"` } `positional-args:"yes" required:"yes"` }
func (*ToolchainAddCmd) Execute ¶ added in v0.0.3
func (c *ToolchainAddCmd) Execute(args []string) error
type ToolchainBuildCmd ¶
type ToolchainBuildCmd struct { Args struct { Toolchains []ToolchainPath `name:"TOOLCHAINS" description:"toolchain paths of toolchains to build"` } `positional-args:"yes" required:"yes"` }
func (*ToolchainBuildCmd) Execute ¶
func (c *ToolchainBuildCmd) Execute(args []string) error
type ToolchainCmd ¶
type ToolchainCmd struct{}
func (*ToolchainCmd) Execute ¶
func (c *ToolchainCmd) Execute(args []string) error
type ToolchainExecOpt ¶
type ToolchainExecOpt struct {
ExeMethods string `short:"m" long:"methods" default:"program,docker" description:"toolchain execution methods" value-name:"METHODS"`
}
func (*ToolchainExecOpt) ToolchainMode ¶
func (o *ToolchainExecOpt) ToolchainMode() toolchain.Mode
type ToolchainGetCmd ¶
type ToolchainGetCmd struct { Args struct { Toolchains []ToolchainPath `name:"TOOLCHAINS" description:"toolchain paths of toolchains to get"` } `positional-args:"yes" required:"yes"` }
func (*ToolchainGetCmd) Execute ¶
func (c *ToolchainGetCmd) Execute(args []string) error
type ToolchainListCmd ¶
type ToolchainListCmd struct { }
func (*ToolchainListCmd) Execute ¶
func (c *ToolchainListCmd) Execute(args []string) error
type ToolchainListToolsCmd ¶
type ToolchainListToolsCmd struct { Op string `short:"p" long:"op" description:"only list tools that perform these operations only" value-name:"OP"` SourceUnitType string `short:"u" long:"source-unit-type" description:"only list tools that operate on this source unit type" value-name:"TYPE"` Args struct { Toolchains []ToolchainPath `name:"TOOLCHAINS" description:"only list tools in these toolchains"` } `positional-args:"yes" required:"yes"` }
func (*ToolchainListToolsCmd) Execute ¶
func (c *ToolchainListToolsCmd) Execute(args []string) error
type ToolchainPath ¶
type ToolchainPath string
func (ToolchainPath) Complete ¶
func (t ToolchainPath) Complete(match string) []flags.Completion
type UnitAuthorshipCmd ¶ added in v0.0.9
type UnitAuthorshipCmd struct { BlameData flags.Filename `long:"blame-data" required:"yes" description:"unit-blame output JSON file for a source unit" value-name:"FILE"` GraphData flags.Filename `long:"graph-data" required:"yes" description:"graph output JSON file for a source unit" value-name:"FILE"` }
func (*UnitAuthorshipCmd) Execute ¶ added in v0.0.9
func (c *UnitAuthorshipCmd) Execute(args []string) error
type UnitBlameCmd ¶ added in v0.0.9
type UnitBlameCmd struct {
UnitData flags.Filename `long:"unit-data" required:"yes" description:"source unit definition JSON file" value-name:"FILE"`
}
func (*UnitBlameCmd) Execute ¶ added in v0.0.9
func (c *UnitBlameCmd) Execute(args []string) error
type UnitsCmd ¶
type UnitsCmd struct { config.Options ToolchainExecOpt `group:"execution"` Output struct { Output string `short:"o" long:"output" description:"output format" default:"text" value-name:"text|json"` } `group:"output"` Args struct { Dir Directory `name:"DIR" default:"." description:"root directory of tree to list units in"` } `positional-args:"yes"` }
Click to show internal directories.
Click to hide internal directories.