wip cli
This commit is contained in:
25
cmd/cli/main.go
Normal file
25
cmd/cli/main.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"flag"
|
||||
"mirror-sync/cmd/cli/commands/apply"
|
||||
"mirror-sync/cmd/cli/commands/version"
|
||||
"os"
|
||||
|
||||
"github.com/google/subcommands"
|
||||
)
|
||||
|
||||
func main() {
|
||||
subcommands.Register(subcommands.HelpCommand(), "help")
|
||||
subcommands.Register(subcommands.FlagsCommand(), "help")
|
||||
subcommands.Register(subcommands.CommandsCommand(), "help")
|
||||
subcommands.Register(&version.VersionCmd{}, "help")
|
||||
|
||||
subcommands.Register(&apply.ApplyCmd{}, "projects")
|
||||
|
||||
flag.Parse()
|
||||
ctx := context.Background()
|
||||
|
||||
os.Exit(int(subcommands.Execute(ctx)))
|
||||
}
|
||||
Reference in New Issue
Block a user