diff --git a/commands/boom.go b/commands/boom.go index 954ddd4..3b90a94 100644 --- a/commands/boom.go +++ b/commands/boom.go @@ -8,13 +8,14 @@ import ( func Boom() *cli.Command { return &cli.Command{ - Name: "boom", - Usage: "explode", - Action: boom, + Name: "boom", + Usage: "explode", + Aliases: []string{"b"}, + Action: boom, } } -func boom(*cli.Context) error { +func boom(c *cli.Context) error { fmt.Println("BOOM") return nil } diff --git a/commands/template.go b/commands/template.go index c253c6c..2b1fb90 100644 --- a/commands/template.go +++ b/commands/template.go @@ -8,13 +8,39 @@ import ( func Template() *cli.Command { return &cli.Command{ - Name: "NAME", - Usage: "USAGE OF COMMAND", - Action: template, + Name: "NAME", + Usage: "USAGE OF COMMAND", + Aliases: []string{"T"}, + Action: action, + Flags: flags(), + Category: "CATEGORY", + Subcommands: subcommands(), } } -func template(*cli.Context) error { +func action(c *cli.Context) error { fmt.Println("TEMPLATE RESPONSE") return nil } + +func flags() []cli.Flag { + return []cli.Flag{ + &cli.StringFlag{ + Name: "test", + Aliases: []string{"t"}, + }, + } +} + +func subcommands() []*cli.Command { + return []*cli.Command{ + { + Name: "NAME", + Usage: "USAGE OF COMMAND", + Aliases: []string{"T"}, + Action: action, + Flags: flags(), + Category: "CATEGORY", + }, + } +} diff --git a/main.go b/main.go index 74cf4b7..9b04593 100644 --- a/main.go +++ b/main.go @@ -9,11 +9,19 @@ import ( func main() { app := &cli.App{ - Name: "KleinCommand", - Usage: "manage your home server", - UsageText: "kleinCommand [category] [command] [arguments...]", + Name: "KleinCommand", + Usage: "manage your home server", + UsageText: "kleinCommand [category] [command] [arguments...]", + Version: "v0.0.1", + Authors: []*cli.Author{ + { + Name: "Darius", + Email: "darius.klein@dariusklein.nl", + }, + }, DefaultCommand: "help", Commands: []*cli.Command{ + commands.Template(), commands.Welcome(), commands.Boom(), commands.BubbleTeaTest(),