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:
32
help/help.go
Normal file
32
help/help.go
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user