lifted-gen.go add flag parse

Signed-off-by: tanberBro <pengfei.song@daocloud.io>
This commit is contained in:
tanberBro 2022-11-08 19:04:37 +08:00
parent 31f97acae3
commit 825081f900
1 changed files with 7 additions and 3 deletions

View File

@ -13,6 +13,7 @@ import (
"strings"
"github.com/olekukonko/tablewriter"
"github.com/spf13/pflag"
)
const (
@ -30,13 +31,16 @@ const (
)
var (
// TODO: add to flag
liftedDir = "pkg/util/lifted"
output = "pkg/util/lifted/doc.go"
liftedDir = ""
output = ""
excludeFiles = []string{"doc.go"}
)
func main() {
pflag.StringVar(&liftedDir, "lifted-dir", "pkg/util/lifted", "The path of lifted dir")
pflag.StringVarP(&output, "output", "o", "pkg/util/lifted/doc.go", "The path of lifted-gen output")
pflag.Parse()
a := newAnalyzer()
a.collect(liftedDir)
a.dump(output)