-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
54 lines (48 loc) · 1 KB
/
main.go
File metadata and controls
54 lines (48 loc) · 1 KB
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
package main
import (
_ "embed"
"fmt"
"os"
"strings"
"github.com/MixinNetwork/computer/cmd"
"github.com/urfave/cli/v2"
)
//go:embed README.md
var README string
//go:embed VERSION
var VERSION string
func main() {
VERSION = strings.TrimSpace(VERSION)
if strings.Contains(VERSION, "COMMIT") {
panic("please build the application using make command.")
}
app := &cli.App{
Name: "computer",
Usage: "Mixin Trusted Computer",
Version: VERSION,
EnableBashCompletion: true,
Metadata: map[string]any{
"README": README,
"VERSION": VERSION,
},
Commands: []*cli.Command{
{
Name: "boot",
Usage: "Run the computer node",
Action: cmd.ComputerBootCmd,
Flags: []cli.Flag{
&cli.StringFlag{
Name: "config",
Aliases: []string{"c"},
Value: "~/.mixin/computer/config.toml",
Usage: "The configuration file path",
},
},
},
},
}
err := app.Run(os.Args)
if err != nil {
fmt.Println(err)
}
}