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

Pull command flags out of main() and into its own file

This commit is contained in:
Chris Cummer
2018-05-29 17:38:56 -07:00
parent ca48d34566
commit a46ff5c10e
4 changed files with 55 additions and 61 deletions

View File

@@ -11,22 +11,6 @@ import (
"github.com/senorprogrammer/wtf/weather"
)
//func DisplayCommandInfo(args []string, version string) {
//if len(args) == 0 {
//return
//}
//cmd := args[0]
//switch cmd {
//case "help", "--help":
//DisplayHelpInfo(args)
//case "version", "--version":
//DisplayVersionInfo(version)
//}
//}
func DisplayHelpInfo(moduleName string) {
if moduleName != "" {
fmt.Printf("%s\n", helpFor(moduleName))
@@ -37,11 +21,6 @@ func DisplayHelpInfo(moduleName string) {
os.Exit(0)
}
func DisplayVersionInfo(version string) {
fmt.Printf("Version: %s\n", version)
os.Exit(0)
}
func helpFor(moduleName string) string {
switch moduleName {
case "git":