forked from prysmaticlabs/prysm
-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.go
64 lines (57 loc) · 1020 Bytes
/
main.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
57
58
59
60
61
62
63
64
package main
import (
"embed"
"log"
"os"
"github.com/urfave/cli/v2"
)
var (
dirFlag = &cli.StringFlag{
Name: "dir",
Value: "",
Usage: "Target directory",
Required: true,
}
)
//go:embed data
var specFS embed.FS
var specDirs = map[string][]string{
"specs/phase0": {
"beacon-chain.md",
"fork-choice.md",
"validator.md",
"weak-subjectivity.md",
},
"ssz": {
"merkle-proofs.md",
},
}
func main() {
app := &cli.App{
Name: "Specs checker utility",
Description: "Checks that specs pseudo code used in comments is up to date",
Usage: "helps keeping specs pseudo code up to date!",
Commands: []*cli.Command{
{
Name: "check",
Usage: "Checks that all doc strings",
Flags: []cli.Flag{
dirFlag,
},
Action: check,
},
{
Name: "download",
Usage: "Downloads the latest specs docs",
Action: download,
Flags: []cli.Flag{
dirFlag,
},
},
},
}
err := app.Run(os.Args)
if err != nil {
log.Fatal(err)
}
}