We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a0ff256 commit 4671a58Copy full SHA for 4671a58
go-bindata/main.go
@@ -82,6 +82,24 @@ func parseArgs() *bindata.Config {
82
c.Input[i] = parseInput(flag.Arg(i))
83
}
84
85
+ // Change pkg to containing directory of output. If output flag is set and package flag is not.
86
+ pkgSet := false
87
+ outputSet := false
88
+ flag.Visit(func(f *flag.Flag) {
89
+ if f.Name == "pkg" {
90
+ pkgSet = true
91
+ }
92
+ if f.Name == "o" {
93
+ outputSet = true
94
95
+ })
96
+ if outputSet && !pkgSet {
97
+ pkg := filepath.Base(filepath.Dir(c.Output))
98
+ if pkg != "." && pkg != "/" {
99
+ c.Package = pkg
100
101
102
+
103
return c
104
105
0 commit comments