diff --git a/cmd/soft/man.go b/cmd/soft/man.go new file mode 100644 index 000000000..1ddcd306a --- /dev/null +++ b/cmd/soft/man.go @@ -0,0 +1,25 @@ +//go:build mango +// +build mango + +package main + +import ( + "flag" + "fmt" + "os" + + "github.com/muesli/mango" + "github.com/muesli/mango/mflag" + "github.com/muesli/roff" +) + +func init() { + manPage := mango.NewManPage(1, "soft", "A self-hostable Git server for the command line"). + WithLongDescription("Soft Serve is a self-hostable Git server for the command line."). + WithSection("Copyright", "(C) 2021-2022 Charmbracelet, Inc.\n"+ + "Released under MIT license.") + + flag.VisitAll(mflag.FlagVisitor(manPage)) + fmt.Println(manPage.Build(roff.NewDocument())) + os.Exit(0) +} diff --git a/go.mod b/go.mod index fad693743..57d0ed3ea 100644 --- a/go.mod +++ b/go.mod @@ -22,6 +22,11 @@ require ( gopkg.in/yaml.v2 v2.4.0 ) +require ( + github.com/muesli/mango v0.1.0 + github.com/muesli/roff v0.1.0 +) + require ( github.com/Microsoft/go-winio v0.5.1 // indirect github.com/ProtonMail/go-crypto v0.0.0-20220113124808-70ae35bab23f // indirect diff --git a/go.sum b/go.sum index e81c7e4c7..6c43ed67f 100644 --- a/go.sum +++ b/go.sum @@ -104,9 +104,13 @@ github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b/go.mod h1:fQuZ0gauxyBcmsdE3ZT4NasjaRdxmbCS0jRHsrWu3Ho= github.com/muesli/ansi v0.0.0-20211031195517-c9f0611b6c70 h1:kMlmsLSbjkikxQJ1IPwaM+7LJ9ltFu/fi8CRzvSnQmA= github.com/muesli/ansi v0.0.0-20211031195517-c9f0611b6c70/go.mod h1:fQuZ0gauxyBcmsdE3ZT4NasjaRdxmbCS0jRHsrWu3Ho= +github.com/muesli/mango v0.1.0 h1:DZQK45d2gGbql1arsYA4vfg4d7I9Hfx5rX/GCmzsAvI= +github.com/muesli/mango v0.1.0/go.mod h1:5XFpbC8jY5UUv89YQciiXNlbi+iJgt29VDC5xbzrLL4= github.com/muesli/reflow v0.2.1-0.20210115123740-9e1d0d53df68/go.mod h1:Xk+z4oIWdQqJzsxyjgl3P22oYZnHdZ8FFTHAQQt5BMQ= github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s= github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8= +github.com/muesli/roff v0.1.0 h1:YD0lalCotmYuF5HhZliKWlIx7IEhiXeSfq7hNjFqGF8= +github.com/muesli/roff v0.1.0/go.mod h1:pjAHQM9hdUUwm/krAfrLGgJkXJ+YuhtsfZ42kieB2Ig= github.com/muesli/termenv v0.9.0/go.mod h1:R/LzAKf+suGs4IsO95y7+7DpFHO0KABgnZqtlyx2mBw= github.com/muesli/termenv v0.11.0 h1:fwNUbu2mfWlgicwG7qYzs06aOI8Z/zKPAv8J4uKbT+o= github.com/muesli/termenv v0.11.0/go.mod h1:Bd5NYQ7pd+SrtBSrSNoBBmXlcY8+Xj4BMJgh8qcZrvs=