2018-07-20 16:47:06 +03:00
|
|
|
// +build ignore
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"log"
|
|
|
|
"os"
|
|
|
|
"path"
|
2019-02-23 15:02:18 +03:00
|
|
|
"path/filepath"
|
2019-05-22 21:53:53 +03:00
|
|
|
"time"
|
2018-08-06 04:22:36 +03:00
|
|
|
|
|
|
|
"github.com/MichaelMure/git-bug/commands"
|
|
|
|
"github.com/spf13/cobra/doc"
|
2018-07-20 16:47:06 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
cwd, _ := os.Getwd()
|
2019-02-23 15:02:18 +03:00
|
|
|
dir := path.Join(cwd, "doc", "man")
|
2018-07-20 16:47:06 +03:00
|
|
|
|
2019-05-22 21:53:53 +03:00
|
|
|
date := time.Date(2019, 4, 1, 12, 0, 0, 0, time.UTC)
|
|
|
|
|
2018-07-20 16:47:06 +03:00
|
|
|
header := &doc.GenManHeader{
|
2018-08-06 04:22:36 +03:00
|
|
|
Title: "GIT-BUG",
|
|
|
|
Section: "1",
|
2019-05-22 21:53:53 +03:00
|
|
|
Date: &date,
|
2018-09-02 16:53:44 +03:00
|
|
|
Source: "Generated from git-bug's source code",
|
2018-07-20 16:47:06 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
fmt.Println("Generating manpage ...")
|
|
|
|
|
2019-02-23 15:02:18 +03:00
|
|
|
files, err := filepath.Glob(dir + "/*.1")
|
|
|
|
if err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
|
|
|
for _, f := range files {
|
|
|
|
if err := os.Remove(f); err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
err = doc.GenManTree(commands.RootCmd, header, dir)
|
2018-07-20 16:47:06 +03:00
|
|
|
if err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
|
|
|
}
|