[documentation] Extract usage notes into separate file.

This commit is contained in:
Ciprian Dorin Craciun 2021-12-16 13:32:05 +02:00
parent fc0dde974b
commit 51b0d777ed
4 changed files with 99 additions and 89 deletions

View file

@ -27,6 +27,8 @@ import "go.etcd.io/bbolt"
import . "github.com/volution/kawipiko/lib/common" import . "github.com/volution/kawipiko/lib/common"
import . "github.com/volution/kawipiko/lib/archiver" import . "github.com/volution/kawipiko/lib/archiver"
import _ "embed"
@ -958,44 +960,7 @@ func main_0 () (error) {
_flags := flag.NewFlagSet ("kawipiko-archiver", flag.ContinueOnError) _flags := flag.NewFlagSet ("kawipiko-archiver", flag.ContinueOnError)
_flags.Usage = func () () { _flags.Usage = func () () {
fmt.Fprintf (os.Stderr, "%s", fmt.Fprintf (os.Stderr, "%s", usageText)
`
==== kawipiko -- blazingly fast static HTTP server ====
| Documentation, issues and sources:
| * https://github.com/volution/kawipiko
| Authors:
| * Ciprian Dorin Craciun
| ciprian@volution.ro
| ciprian.craciun@gmail.com
| https://volution.ro/ciprian
-----------------------------------------------------------
kawipiko-archiver
--sources <path>
--archive <path>
--compress <gzip | zopfli | brotli | identity>
--compress-level <number>
--compress-cache <path>
--exclude-index
--exclude-strip
--exclude-cache
--include-etag
--exclude-file-listing
--include-folder-listing
--progress
--debug
** for details see:
https://github.com/volution/kawipiko#kawipiko-archiver
`)
} }
_sourcesFolder_0 := _flags.String ("sources", "", "") _sourcesFolder_0 := _flags.String ("sources", "", "")
@ -1174,3 +1139,9 @@ func main_0 () (error) {
return nil return nil
} }
//go:embed usage.txt
var usageText string

View file

@ -0,0 +1,34 @@
==== kawipiko -- blazingly fast static HTTP server ====
| Documentation, issues and sources:
| * https://github.com/volution/kawipiko
| Authors:
| * Ciprian Dorin Craciun
| ciprian@volution.ro
| ciprian.craciun@gmail.com
| https://volution.ro/ciprian
-----------------------------------------------------------
kawipiko-archiver
--sources <path>
--archive <path>
--compress <gzip | zopfli | brotli | identity>
--compress-level <number>
--compress-cache <path>
--exclude-index
--exclude-strip
--exclude-cache
--include-etag
--exclude-file-listing
--include-folder-listing
--progress
--debug
** for details see:
https://github.com/volution/kawipiko#kawipiko-archiver

View file

@ -33,6 +33,8 @@ import "github.com/valyala/fasthttp/reuseport"
import . "github.com/volution/kawipiko/lib/common" import . "github.com/volution/kawipiko/lib/common"
import . "github.com/volution/kawipiko/lib/server" import . "github.com/volution/kawipiko/lib/server"
import _ "embed"
@ -484,57 +486,7 @@ func main_0 () (error) {
_flags := flag.NewFlagSet ("kawipiko-server", flag.ContinueOnError) _flags := flag.NewFlagSet ("kawipiko-server", flag.ContinueOnError)
_flags.Usage = func () () { _flags.Usage = func () () {
fmt.Fprintf (os.Stderr, "%s", fmt.Fprintf (os.Stderr, "%s", usageText)
`
==== kawipiko -- blazingly fast static HTTP server ====
| Documentation, issues and sources:
| * https://github.com/volution/kawipiko
| Authors:
| * Ciprian Dorin Craciun
| ciprian@volution.ro
| ciprian.craciun@gmail.com
| https://volution.ro/ciprian
-----------------------------------------------------------
kawipiko-server
--archive <path>
--archive-inmem (memory-loaded archive file)
--archive-mmap (memory-mapped archive file)
--archive-preload (preload archive in OS cache)
--bind <ip>:<port> (HTTP, only HTTP/1.1)
--bind-tls <ip>:<port> (HTTPS, only HTTP/1.1)
--bind-tls-2 <ip>:<port> (HTTPS, with HTTP/2)
--tls-bundle <path> (TLS certificate bundle)
--tls-public <path> (TLS certificate public)
--tls-private <path> (TLS certificate private)
--processes <count> (of slave processes)
--threads <count> (of threads per process)
--index-all
--index-paths
--index-data-meta
--index-data-content
--security-headers-tls
--security-headers-disable
--timeout-disable
--profile-cpu <path>
--profile-mem <path>
--debug
--dummy
--delay <duration>
** for details see:
https://github.com/volution/kawipiko#kawipiko-server
`)
} }
_bind_0 := _flags.String ("bind", "", "") _bind_0 := _flags.String ("bind", "", "")
@ -1493,3 +1445,9 @@ func (_listener *splitListener) Addr () (net.Addr) {
} }
} }
//go:embed usage.txt
var usageText string

View file

@ -0,0 +1,47 @@
==== kawipiko -- blazingly fast static HTTP server ====
| Documentation, issues and sources:
| * https://github.com/volution/kawipiko
| Authors:
| * Ciprian Dorin Craciun
| ciprian@volution.ro
| ciprian.craciun@gmail.com
| https://volution.ro/ciprian
-----------------------------------------------------------
kawipiko-server
--archive <path>
--archive-inmem (memory-loaded archive file)
--archive-mmap (memory-mapped archive file)
--archive-preload (preload archive in OS cache)
--bind <ip>:<port> (HTTP, only HTTP/1.1)
--bind-tls <ip>:<port> (HTTPS, only HTTP/1.1)
--bind-tls-2 <ip>:<port> (HTTPS, with HTTP/2)
--tls-bundle <path> (TLS certificate bundle)
--tls-public <path> (TLS certificate public)
--tls-private <path> (TLS certificate private)
--processes <count> (of slave processes)
--threads <count> (of threads per process)
--index-all
--index-paths
--index-data-meta
--index-data-content
--security-headers-tls
--security-headers-disable
--timeout-disable
--profile-cpu <path>
--profile-mem <path>
--debug
--dummy
--delay <duration>
** for details see:
https://github.com/volution/kawipiko#kawipiko-server