forked from sourcegraph/src-cli
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbatch.go
More file actions
51 lines (40 loc) · 1.15 KB
/
batch.go
File metadata and controls
51 lines (40 loc) · 1.15 KB
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
43
44
45
46
47
48
49
50
51
package main
import (
"flag"
"fmt"
)
var batchCommands commander
func init() {
usage := `'src batch' manages batch changes on a Sourcegraph instance.
Usage:
src batch command [command options]
The commands are:
apply applies a batch spec to create or update a batch
change
new creates a new batch spec YAML file
preview creates a batch spec to be previewed or applied
remote creates server side batch changes
repos,repositories queries the exact repositories that a batch spec will
apply to
validate validates a batch spec
Use "src batch [command] -h" for more information about a command.
`
flagSet := flag.NewFlagSet("batch", flag.ExitOnError)
handler := func(args []string) error {
batchCommands.run(flagSet, "src batch", usage, args)
return nil
}
// Register the command.
commands = append(commands, &command{
flagSet: flagSet,
aliases: []string{
"batchchange",
"batch-change",
"batchchanges",
"batch-changes",
"batches",
},
handler: handler,
usageFunc: func() { fmt.Println(usage) },
})
}