Skip to content

Commit

Permalink
feat(help): add help place holder
Browse files Browse the repository at this point in the history
  • Loading branch information
Milerius committed Jul 1, 2021
1 parent dd1dfd5 commit aee4caa
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cli/completer.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ func Completer(t prompt.Document) []prompt.Suggest {
return []prompt.Suggest{
{Text: "exit", Description: "Quit the application"},
{Text: "init", Description: "Init MM2 Dependencies, Download/Setup"},
{Text: "help <command>", Description: "Show the help for a specific command"},
{Text: "help", Description: "Show the global help"},
}
}
6 changes: 6 additions & 0 deletions cli/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ func Executor(fullCommand string) {
switch command[0] {
case "init":
InitMM2()
case "help":
if len(command) == 1 {
ShowGlobalHelp()
} else if len(command) > 1 {
ShowCommandHelp(command[0])
}
case "exit":
fmt.Println("Bye")
os.Exit(0)
Expand Down
11 changes: 11 additions & 0 deletions cli/help.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package cli

import "fmt"

func ShowGlobalHelp() {
fmt.Println("TODO: global help")
}

func ShowCommandHelp(command string) {
fmt.Println("TODO: command help")
}

0 comments on commit aee4caa

Please sign in to comment.