mirror of
https://gitee.com/johng/gf
synced 2026-06-23 08:29:25 +08:00
29 lines
690 B
Go
29 lines
690 B
Go
// Copyright GoFrame gf Author(https://goframe.org). All Rights Reserved.
|
|
//
|
|
// This Source Code Form is subject to the terms of the MIT License.
|
|
// If a copy of the MIT was not distributed with this file,
|
|
// You can obtain one at https://github.com/gogf/gf.
|
|
|
|
package main
|
|
|
|
import (
|
|
"github.com/gogf/gf/cmd/gf/v2/gfcmd"
|
|
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
|
|
"github.com/gogf/gf/v2/errors/gerror"
|
|
"github.com/gogf/gf/v2/os/gctx"
|
|
)
|
|
|
|
func main() {
|
|
var (
|
|
ctx = gctx.GetInitCtx()
|
|
)
|
|
command, err := gfcmd.GetCommand(ctx)
|
|
if err != nil {
|
|
mlog.Fatalf(`%+v`, err)
|
|
}
|
|
if command == nil {
|
|
panic(gerror.New(`retrieve root command failed for "gf"`))
|
|
}
|
|
command.Run(ctx)
|
|
}
|