-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.go
More file actions
46 lines (39 loc) · 774 Bytes
/
cli.go
File metadata and controls
46 lines (39 loc) · 774 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
43
44
45
46
package main
import (
"fmt"
"log"
"os"
"github.com/dedis/twins-demo-reset/server"
"github.com/urfave/cli/v2"
)
// managed by govvv
var GitSummary string
func main() {
cli.VersionPrinter = func(c *cli.Context) {
fmt.Printf("%s\n", GitSummary)
}
app := &cli.App{
Name: "reset",
Usage: "an HTTP server that resets the TWIN agents for the demo",
Commands: []*cli.Command{
{
Name: "serve",
Usage: "start the organizer server",
Flags: []cli.Flag{
&cli.IntFlag{
Name: "port",
Aliases: []string{"p"},
Usage: "port to listen websocket connections on",
Value: 9999,
},
},
Action: server.Serve,
},
},
Version: GitSummary,
}
err := app.Run(os.Args)
if err != nil {
log.Fatal(err)
}
}