-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
main.go
32 lines (25 loc) · 639 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
// Entry-Point to our code.
package main
import (
"context"
"flag"
"os"
"github.com/google/subcommands"
)
//
// Our main-driver.
//
// Load the sub-commands we have available, and pass control appropriately.
//
func main() {
subcommands.Register(subcommands.HelpCommand(), "")
subcommands.Register(subcommands.FlagsCommand(), "")
subcommands.Register(subcommands.CommandsCommand(), "")
subcommands.Register(&lexCmd{}, "")
subcommands.Register(&parseCmd{}, "")
subcommands.Register(&runCmd{}, "")
subcommands.Register(&versionCmd{}, "")
flag.Parse()
ctx := context.Background()
os.Exit(int(subcommands.Execute(ctx)))
}