-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.go
48 lines (44 loc) · 1009 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
package main
import (
"context"
"os"
"github.com/urfave/cli/v3"
"github.com/zyrouge/pho/commands"
"github.com/zyrouge/pho/core"
"github.com/zyrouge/pho/utils"
)
func main() {
app := &cli.Command{
Name: core.AppExecutableName,
Usage: core.AppDescription,
Version: core.AppVersion,
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "verbose",
Persistent: true,
Action: func(_ context.Context, _ *cli.Command, b bool) error {
utils.LogDebugEnabled = b
return nil
},
},
},
Authors: []any{"Zyrouge"},
Commands: []*cli.Command{
&commands.InitCommand,
&commands.InstallCommand,
&commands.UninstallCommand,
&commands.UpdateCommand,
&commands.RunCommand,
&commands.ListCommand,
&commands.ViewCommand,
&commands.TidyBrokenCommand,
&commands.SelfUpdateCommand,
&commands.AppConfigCommand,
},
EnableShellCompletion: true,
}
if err := app.Run(context.Background(), os.Args); err != nil {
utils.LogError(err)
os.Exit(1)
}
}