Merge pull request #2756 from tanberBro/master
lifted-gen.go add flag parse
This commit is contained in:
commit
acc751c7a3
|
@ -13,6 +13,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/olekukonko/tablewriter"
|
"github.com/olekukonko/tablewriter"
|
||||||
|
"github.com/spf13/pflag"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -30,13 +31,16 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// TODO: add to flag
|
liftedDir = ""
|
||||||
liftedDir = "pkg/util/lifted"
|
output = ""
|
||||||
output = "pkg/util/lifted/doc.go"
|
|
||||||
excludeFiles = []string{"doc.go"}
|
excludeFiles = []string{"doc.go"}
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
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 := newAnalyzer()
|
||||||
a.collect(liftedDir)
|
a.collect(liftedDir)
|
||||||
a.dump(output)
|
a.dump(output)
|
||||||
|
|
Loading…
Reference in New Issue