diff --git a/cli/app.go b/cli/app.go new file mode 100644 index 0000000..1a63b1e --- /dev/null +++ b/cli/app.go @@ -0,0 +1,20 @@ +package cli + +import "os" + +type AppInterface interface { + AddCommand(name string, command Command) + Run() +} + +type App struct { + commands map[string]Command +} + +func (a *App) AddCommand(name string, command Command) { + a.commands[name] = command +} + +func (a *App) Run() { + a.commands[os.Args[1]].Run() +}