serve.go 513 B

123456789101112131415161718192021222324
  1. package command
  2. import (
  3. "fmt"
  4. "github.com/spf13/cobra"
  5. )
  6. var ServeCommand = &cobra.Command{
  7. Use: "server",
  8. Short: "Run the kurz server",
  9. Long: fmt.Printf("Run the kurz server, using the configuration in ~/%s", ConfigName),
  10. Run: serveCommand,
  11. }
  12. func serveCommand(c *cobra.Command, args []string) {
  13. fmt.Println("Pretend to serve kurz.")
  14. }
  15. var servePort int
  16. func init() {
  17. ServeCommand.Flags().IntVarP(&servePort, "port", "p", 80, "The IP port on which to listen")
  18. kurz.AddCommand(ServeCommand)
  19. }