2024-05-24 11:44:03 +02:00
|
|
|
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"
|
2024-05-24 11:44:03 +02:00
|
|
|
"log"
|
2025-07-19 20:58:05 +02:00
|
|
|
"net/mail"
|
2024-05-24 11:44:03 +02:00
|
|
|
"os"
|
|
|
|
|
)
|
|
|
|
|
|
2025-07-19 20:58:05 +02:00
|
|
|
var Config common.Config
|
|
|
|
|
|
2024-05-24 11:44:03 +02:00
|
|
|
func main() {
|
2025-07-19 20:58:05 +02:00
|
|
|
Config, _ = common.ReadConfig()
|
2024-05-24 20:32:42 +02:00
|
|
|
|
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
|
|
|
},
|
|
|
|
|
},
|
2024-05-24 11:44:03 +02:00
|
|
|
DefaultCommand: "help",
|
|
|
|
|
Commands: []*cli.Command{
|
2025-07-19 20:58:05 +02:00
|
|
|
config.Category(),
|
|
|
|
|
templateCommand.Category(),
|
2024-05-24 11:44:03 +02:00
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
|
2025-07-19 20:58:05 +02:00
|
|
|
if err := app.Run(context.Background(), os.Args); err != nil {
|
2024-05-24 11:44:03 +02:00
|
|
|
log.Fatal(err)
|
|
|
|
|
}
|
|
|
|
|
}
|