hoster/cmd/hoster_cli/hoster.go

51 lines
958 B
Go
Raw Normal View History

2024-08-28 12:31:17 +02:00
package main
import (
"hoster/cmd/hoster_cli/commands"
2024-08-28 12:31:17 +02:00
"hoster/internals/conf"
"os"
"github.com/kataras/golog"
"github.com/urfave/cli/v2"
)
func main() {
2024-08-28 12:32:33 +02:00
conf.LoadConfig(".hoster.yml")
2024-08-28 12:31:17 +02:00
app := &cli.App{
2024-08-28 12:42:07 +02:00
Name: "hoster",
Usage: "Hoster",
Version: "1.0.1",
2024-08-28 12:31:17 +02:00
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,
2024-08-28 12:31:17 +02:00
},
},
}
if err := app.Run(os.Args); err != nil {
golog.Fatal(err)
}
}