forked from sourcegraph/sourcegraph-public-snapshot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
37 lines (31 loc) · 625 Bytes
/
main.go
File metadata and controls
37 lines (31 loc) · 625 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
package main
import (
"context"
"flag"
"fmt"
"os"
"github.com/peterbourgon/ff/v3/ffcli"
)
func main() {
if err := mainErr(); err != nil {
fmt.Printf("error: %s\n", err)
os.Exit(1)
}
}
var rootFlagSet = flag.NewFlagSet("depgraph", flag.ExitOnError)
var rootCommand = &ffcli.Command{
ShortUsage: "depgraph [flags] <subcommand>",
FlagSet: rootFlagSet,
Subcommands: []*ffcli.Command{
summaryCommand,
traceCommand,
traceInternalCommand,
lintCommand,
},
}
func mainErr() error {
if err := rootCommand.Parse(os.Args[1:]); err != nil {
return err
}
return rootCommand.Run(context.Background())
}