-
Notifications
You must be signed in to change notification settings - Fork 23
/
cmd.go
31 lines (26 loc) · 820 Bytes
/
cmd.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
package cmd
import (
// used to embed markdown.
_ "embed"
"fmt"
"github.com/synapsecns/sanguine/core/commandline"
"github.com/synapsecns/sanguine/core/config"
"github.com/urfave/cli/v2"
)
// Start starts the command line.
func Start(args []string, buildInfo config.BuildInfo) {
app := cli.NewApp()
app.Name = buildInfo.Name()
app.Description = buildInfo.VersionString() + "guard is used to detect and report fraudulent attestations."
app.Usage = fmt.Sprintf("%s --help", buildInfo.Name())
app.EnableBashCompletion = true
// commands
app.Commands = cli.Commands{GuardInfoCommand, GuardRunCommand}
shellCommand := commandline.GenerateShellCommand(app.Commands)
app.Commands = append(app.Commands, shellCommand)
app.Action = shellCommand.Action
err := app.Run(args)
if err != nil {
panic(err)
}
}