lifted-gen.go add flag parse
Signed-off-by: tanberBro <pengfei.song@daocloud.io>
This commit is contained in:
parent
31f97acae3
commit
825081f900
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue