Skip to content

Commit

Permalink
Adding cli app
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasCarioca committed Oct 4, 2021
1 parent fff080b commit 951590a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions cli/app.go
Original file line number Diff line number Diff line change
@@ -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()
}

0 comments on commit 951590a

Please sign in to comment.