-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy pathdebug.go
More file actions
42 lines (30 loc) · 944 Bytes
/
debug.go
File metadata and controls
42 lines (30 loc) · 944 Bytes
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 debugCommands commander
func init() {
usage := `'src debug' gathers and bundles debug data from a Sourcegraph deployment for troubleshooting.
Usage:
src debug command [command options]
The commands are:
kube dumps context from k8s deployments
compose dumps context from docker-compose deployments
server dumps context from single-container deployments
Use "src debug command -h" for more information about a subcommands.
src debug has access to flags on src -- Ex: src -v kube -o foo.zip
`
flagSet := flag.NewFlagSet("debug", flag.ExitOnError)
handler := func(args []string) error {
debugCommands.run(flagSet, "src debug", usage, args)
return nil
}
// Register the command.
commands = append(commands, &command{
flagSet: flagSet,
aliases: []string{},
handler: handler,
usageFunc: func() { fmt.Println(usage) },
})
}