-
Notifications
You must be signed in to change notification settings - Fork 1
/
commands.go
56 lines (51 loc) · 1.07 KB
/
commands.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package main
import "github.com/urfave/cli"
func setupCommands() *cli.App {
app := cli.NewApp()
app.HelpName = "The UBCCSSS Exam App"
app.Commands = []cli.Command{
{
Name: "serve",
Aliases: []string{"s"},
Usage: "serve the site on :8080",
Action: serveSite,
Flags: []cli.Flag{
cli.IntFlag{
Name: "port",
Value: 8080,
Usage: "The port to run the webserver on.",
},
cli.StringFlag{
Name: "user",
Value: "admin",
Usage: "Username for /admin/.",
},
cli.StringFlag{
Name: "pass",
Value: "",
Usage: "Password for /admin/. Admin interface is disabled if not set.",
},
},
},
{
Name: "indexugrad",
Usage: "saves all top level HTML files to archive.org",
Action: indexUGrad,
Flags: []cli.Flag{
cli.StringFlag{
Name: "user",
Value: "q7w9a",
Usage: "ssh username",
},
cli.StringFlag{
Name: "server",
Value: "annacis.ugrad.cs.ubc.ca",
Usage: "ssh server",
},
},
},
setupEgressCommands(),
setupIngressCommands(),
}
return app
}