Files
ispctl/main.go
T
2023-06-09 17:25:12 +03:00

50 lines
753 B
Go

package main
import (
"fmt"
"log"
"os"
"github.com/urfave/cli/v2"
"ispctl/command"
"ispctl/flag"
)
var version = "1.1.0"
func main() {
initCommands()
}
func initCommands() {
app := cli.NewApp()
app.Usage = "isp configurations updater"
app.Version = version
app.Flags = []cli.Flag{
flag.Host,
flag.Unsafe,
}
app.EnableBashCompletion = true
app.Commands = []*cli.Command{
command.Status(),
command.Get(),
command.Set(),
command.Delete(),
command.Schema(),
command.CommonConfig(),
command.Merge(),
command.GitGet(),
}
app.BashComplete = func(context *cli.Context) {
for _, appCommand := range app.Commands {
fmt.Println(appCommand.Name)
}
}
err := app.Run(os.Args)
if err != nil {
log.Fatal(err)
}
}