Merge pull request #2756 from tanberBro/master

lifted-gen.go add flag parse
This commit is contained in:
karmada-bot 2022-11-09 20:48:54 +08:00 committed by GitHub
commit acc751c7a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)