-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
51 lines (40 loc) · 999 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
package main
import (
"fmt"
"os"
"searchEngineTest/script"
"github.com/urfave/cli/v2"
)
var version = "v0.0.2"
const appName = "searchEngineTest"
const appAbout = "Twelveeee"
const appDescription = "搜索引擎测试"
const appCopyright = "(c) 2023 Twelveeee @ Twelveeee"
// Metadata contains build specific information.
var Metadata = map[string]interface{}{
"Name": appName,
"About": appAbout,
"Description": appDescription,
"Version": version,
}
func main() {
defer func() {
if err := recover(); err != nil {
fmt.Printf("run recover %v \n", err)
os.Exit(1)
}
}()
app := cli.NewApp()
app.Usage = appAbout
app.Description = appDescription
app.Version = version
app.Copyright = appCopyright
app.EnableBashCompletion = true
app.Commands = script.Commands
app.Flags = script.Flags
app.Metadata = Metadata
if err := app.Run(os.Args); err != nil {
fmt.Printf("run error %v \n", err)
}
fmt.Printf("====================================\n")
}