mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
40 lines
824 B
Go
40 lines
824 B
Go
package help
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/senorprogrammer/wtf/git"
|
|
"github.com/senorprogrammer/wtf/github"
|
|
"github.com/senorprogrammer/wtf/textfile"
|
|
"github.com/senorprogrammer/wtf/todo"
|
|
"github.com/senorprogrammer/wtf/weather"
|
|
)
|
|
|
|
func DisplayModuleInfo(moduleName string) {
|
|
if moduleName != "" {
|
|
fmt.Printf("%s\n", helpFor(moduleName))
|
|
} else {
|
|
fmt.Println("\n --module takes a module name as an argument, i.e: '--module=github'")
|
|
}
|
|
|
|
os.Exit(0)
|
|
}
|
|
|
|
func helpFor(moduleName string) string {
|
|
switch moduleName {
|
|
case "git":
|
|
return git.HelpText
|
|
case "github":
|
|
return github.HelpText
|
|
case "textfile":
|
|
return textfile.HelpText
|
|
case "todo":
|
|
return todo.HelpText
|
|
case "weather":
|
|
return weather.HelpText
|
|
default:
|
|
return fmt.Sprintf("\n There is no help available for '%s'", moduleName)
|
|
}
|
|
}
|