-
Notifications
You must be signed in to change notification settings - Fork 64
/
Copy pathactions.go
42 lines (31 loc) · 898 Bytes
/
actions.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package main
import (
"flag"
"fmt"
)
var actionsCommands commander
func init() {
usage := `'src actions' is a tool that manages actions on a Sourcegraph instance.
EXPERIMENTAL: Actions are experimental functionality on Sourcegraph and in the 'src' tool.
Usage:
src actions command [command options]
The commands are:
exec executes an action to produce patches
scope-query list the repositories matched by "scopeQuery" in action
Use "src actions [command] -h" for more information about a command.
`
flagSet := flag.NewFlagSet("actions", flag.ExitOnError)
handler := func(args []string) error {
actionsCommands.run(flagSet, "src actions", usage, args)
return nil
}
// Register the command.
commands = append(commands, &command{
flagSet: flagSet,
aliases: []string{"action"},
handler: handler,
usageFunc: func() {
fmt.Println(usage)
},
})
}