add simple description in command

This commit is contained in:
Ronmi Ren 2025-01-12 21:08:02 +08:00
commit 11d3892bda
2 changed files with 13 additions and 0 deletions

View file

@ -23,6 +23,13 @@ import (
var listenCmd = &cobra.Command{ var listenCmd = &cobra.Command{
Use: "listen", Use: "listen",
Short: "Start webhook listener", Short: "Start webhook listener",
Long: `Start webhook listener
Webhook mode utilized Forgejo's webhook to update pages. You have to setup webhook
in Forgejo's settings page to point to this server. When a push event is received,
this server will pull the repository and update the pages. How the pages are served
is up to you, eg. Nginx, Apache, or even a simple Go server.
`,
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
viper.BindPFlags(cmd.Flags()) viper.BindPFlags(cmd.Flags())
// check flags // check flags

View file

@ -22,6 +22,12 @@ import (
var serveCmd = &cobra.Command{ var serveCmd = &cobra.Command{
Use: "serve", Use: "serve",
Short: "Start the static page server.", Short: "Start the static page server.",
Long: `Start the static page server.
Serve mode will start a HTTP server to serve static pages. It just forward requests
to Forgejo server. This is useful when there is not much viewers, or you have other
cache/protection layer like Cloudflare in front of the server.
`,
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
viper.BindPFlags(cmd.Flags()) viper.BindPFlags(cmd.Flags())
// check flags // check flags