help.go 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. package zdaemon
  2. import (
  3. "fmt"
  4. "os"
  5. )
  6. func (zd *ZDaemon) help_install() {
  7. fmt.Println("Usage: ", zd.daemonName, "install <install_type>")
  8. fmt.Println("install_type:")
  9. fmt.Println("\twinsvc\t\tWindows service")
  10. fmt.Println("\twintray\t\tWindows program with tray icon")
  11. fmt.Println("\tsysv\t\tLinux sysv")
  12. fmt.Println("\tsystemd\t\tLinux systemd")
  13. fmt.Println("\topenwrt\t\tOpenwrt service")
  14. }
  15. func (zd *ZDaemon) help() {
  16. if len(os.Args) == 3 {
  17. cmd := os.Args[2]
  18. switch cmd {
  19. case "install":
  20. zd.help_install()
  21. break
  22. case "uninstall":
  23. fmt.Println("This command will uninstall what installed.")
  24. break
  25. case "start":
  26. fmt.Println("This command will start daemon.")
  27. break
  28. case "stop":
  29. fmt.Println("This command will stop daemon.")
  30. break
  31. case "restart":
  32. fmt.Println("This command will restart daemon.")
  33. break
  34. case "status":
  35. fmt.Println("This command will print daemon status.")
  36. break
  37. case "help":
  38. fmt.Println("...? What's your problem? Do you like recurse?")
  39. break
  40. case "enable":
  41. fmt.Println("This command will enable auto startup")
  42. break
  43. case "disable":
  44. fmt.Println("This command will disable auto startup")
  45. break
  46. default:
  47. fmt.Println("Usage: ", zd.daemonName, "help {start|stop|restart|install|uninstall|enable|disable}")
  48. break
  49. }
  50. } else {
  51. fmt.Println("Usage: ", zd.daemonName, "help {start|stop|restart|install|uninstall|enable|disable}")
  52. }
  53. }