1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Move the help code into it's own module

This commit is contained in:
Chris Cummer
2018-05-16 10:39:24 -07:00
parent 27107fcd37
commit c1dd08d594
2 changed files with 63 additions and 24 deletions

32
help/help.go Normal file
View File

@@ -0,0 +1,32 @@
package help
import (
"fmt"
"os"
)
func DisplayCommandInfo(args []string, version string) {
if len(args) == 0 {
return
}
cmd := args[0]
switch cmd {
case "help", "--help":
DisplayHelpInfo()
case "version", "--version":
DisplayVersionInfo(version)
}
}
func DisplayHelpInfo() {
fmt.Println("Help is coming...")
os.Exit(0)
}
func DisplayVersionInfo(version string) {
fmt.Printf("Version: %s\n", version)
os.Exit(0)
}