-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy pathgateway.go
More file actions
39 lines (28 loc) · 870 Bytes
/
gateway.go
File metadata and controls
39 lines (28 loc) · 870 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
package main
import (
"flag"
"fmt"
)
var gatewayCommands commander
func init() {
usage := `'src gateway' interacts with Cody Gateway (directly or through a Sourcegraph instance).
Usage:
src gateway command [command options]
The commands are:
benchmark runs benchmarks against Cody Gateway
benchmark-stream runs benchmarks against Cody Gateway code completion streaming endpoints
Use "src gateway [command] -h" for more information about a command.
`
flagSet := flag.NewFlagSet("gateway", flag.ExitOnError)
handler := func(args []string) error {
gatewayCommands.run(flagSet, "src gateway", usage, args)
return nil
}
// Register the command.
commands = append(commands, &command{
flagSet: flagSet,
aliases: []string{}, // No aliases for gateway command
handler: handler,
usageFunc: func() { fmt.Println(usage) },
})
}