kleinCommand/main.go

42 lines
861 B
Go
Raw Normal View History

package main
import (
2025-07-19 20:58:05 +02:00
"context"
config "github.com/DariusKlein/kleinCommand/commands/config"
"github.com/DariusKlein/kleinCommand/commands/templateCommand"
"github.com/DariusKlein/kleinCommand/common"
"github.com/urfave/cli/v3"
"log"
2025-07-19 20:58:05 +02:00
"net/mail"
"os"
)
2025-07-19 20:58:05 +02:00
var Config common.Config
func main() {
2025-07-19 20:58:05 +02:00
Config, _ = common.ReadConfig()
2025-07-19 20:58:05 +02:00
app := &cli.Command{
2024-05-24 19:41:44 +02:00
Name: "KleinCommand",
2025-07-19 20:58:05 +02:00
Usage: "CLI tool for internal use",
2024-05-24 19:41:44 +02:00
UsageText: "kleinCommand [category] [command] [arguments...]",
2025-07-19 20:58:05 +02:00
Version: "v0.1.0",
2024-05-24 19:41:44 +02:00
HideVersion: true,
2025-07-19 20:58:05 +02:00
Authors: []any{
mail.Address{
Name: "Darius",
Address: "darius.klein@dariusklein.nl",
2024-05-24 12:21:21 +02:00
},
},
DefaultCommand: "help",
Commands: []*cli.Command{
2025-07-19 20:58:05 +02:00
config.Category(),
templateCommand.Category(),
},
}
2025-07-19 20:58:05 +02:00
if err := app.Run(context.Background(), os.Args); err != nil {
log.Fatal(err)
}
}