Move packages to root folder
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 33s

Signed-off-by: Jan Tytgat <jan.tytgat@corelayer.eu>
This commit is contained in:
Jan Tytgat
2025-04-22 13:47:12 +02:00
parent 26059ea3e9
commit 4fab7c8554
17 changed files with 8 additions and 6 deletions

28
application/commander.go Normal file
View File

@ -0,0 +1,28 @@
package application
import "github.com/spf13/cobra"
type Commander interface {
Initialize(f func(c *cobra.Command)) *cobra.Command
}
type Command struct {
Command *cobra.Command
SubCommands []Commander
Configure func(c *cobra.Command)
}
func (c Command) Initialize(f func(c *cobra.Command)) *cobra.Command {
if f != nil {
f(c.Command)
}
if c.Configure != nil {
c.Configure(c.Command)
}
for _, sub := range c.SubCommands {
c.Command.AddCommand(sub.Initialize(f))
}
return c.Command
}