-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.go
71 lines (62 loc) · 1.68 KB
/
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// SPDX-License-Identifier: Apache-2.0
// Copyright 2023 The Prime Citizens
package main
import (
_ "embed" // for go:embed
"errors"
"os"
"time"
"github.com/primecitizens/cli"
"github.com/primecitizens/pcz/cmd/build"
"github.com/primecitizens/pcz/cmd/codegen"
"github.com/primecitizens/pcz/cmd/dev"
// codegen targets
_ "github.com/primecitizens/pcz/cmd/codegen/android"
_ "github.com/primecitizens/pcz/cmd/codegen/darwin"
_ "github.com/primecitizens/pcz/cmd/codegen/js"
_ "github.com/primecitizens/pcz/cmd/codegen/win32"
// dev tool platforms
_ "github.com/primecitizens/pcz/cmd/dev/android"
_ "github.com/primecitizens/pcz/cmd/dev/ios"
_ "github.com/primecitizens/pcz/cmd/dev/nodejs"
_ "github.com/primecitizens/pcz/cmd/dev/web"
_ "github.com/primecitizens/pcz/cmd/dev/webext"
)
func main() {
err := root.Exec(&opts, os.Args[1:]...)
if err != nil && !errors.Is(err, cli.ErrHelpHandled{}) {
panic(err)
}
}
var (
root = cli.Cmd{
Pattern: "pcz",
BriefUsage: "",
Children: _subcmds[:],
}
_subcmds = [...]*cli.Cmd{
dev.Cmd(),
build.Cmd(),
codegen.Cmd(),
}
_routeBuf [8]*cli.Cmd
_posArgBuf [16]string
opts = cli.CmdOptions{
ParseOptions: &cli.ParseOptions{
StartTime: time.Now(),
HandleParseError: nil,
PosArgsBuf: _posArgBuf[:0:len(_posArgBuf)],
HelpArgs: nil,
Extra: nil,
},
RouteBuf: _routeBuf[:0:len(_routeBuf)],
Stdin: os.Stdin,
Stdout: os.Stdout,
Stderr: os.Stderr,
HandleArgError: cli.HandleArgErrorAsHelpRequest,
HandleHelpRequest: cli.HandleHelpRequest,
Extra: nil,
SkipPostRun: false,
DoNotSetFlags: false,
}
)