cli.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package main
  2. import (
  3. "fmt"
  4. "io"
  5. "vocat/internal/buildinfo"
  6. )
  7. func runVersion() {
  8. fmt.Println("vocat " + buildinfo.Build())
  9. }
  10. func printUsage(w io.Writer) {
  11. fmt.Fprintf(w, `vocat %s
  12. Usage:
  13. vocat Run the vocat server (default; same as no arguments).
  14. vocat version Print the build version and exit.
  15. vocat update Check GitHub for a newer release and self-update.
  16. Flags:
  17. --check Only report whether an update is available.
  18. --repo owner/name GitHub repository (default: $VOCAT_REPO).
  19. --target path Binary to replace (default: running exe).
  20. --force Reinstall even at the same version.
  21. Environment:
  22. VOCAT_REPO Fallback for --repo.
  23. GITHUB_TOKEN Optional bearer token for private repos
  24. or higher rate limits.
  25. vocat menu Interactive lifecycle menu (run as root on the host):
  26. change password, restart service, uninstall.
  27. vocat help Show this help message.
  28. When run without a subcommand, vocat starts the HTTP server using
  29. VOCAT_* environment variables or $VOCAT_CONFIG for configuration.
  30. `, buildinfo.Version)
  31. }