hoster/cmd/hoster_cli/hoster.go

51 lines
958 B
Go

package main
import (
"hoster/cmd/hoster_cli/commands"
"hoster/internals/conf"
"os"
"github.com/kataras/golog"
"github.com/urfave/cli/v2"
)
func main() {
conf.LoadConfig(".hoster.yml")
app := &cli.App{
Name: "hoster",
Usage: "Hoster",
Version: "1.0.1",
Commands: []*cli.Command{
{
Name: "new",
Usage: "Setup a new hosting project.",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "name",
Aliases: []string{"n"},
Usage: "The name of the project",
Required: true,
},
&cli.StringFlag{
Name: "domain",
Aliases: []string{"d"},
Usage: "The description of the project",
Required: true,
},
},
Action: commands.CmdNew,
},
{
Name: "check",
Usage: "Check if newer versions of docker images are available",
Action: commands.CmdCheckUpdated,
},
},
}
if err := app.Run(os.Args); err != nil {
golog.Fatal(err)
}
}