mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-16 23:29:21 +00:00
codegen: Make import-boss do it's own flags
This commit is contained in:
parent
1fed36b984
commit
5b2d4384c7
@ -18,6 +18,7 @@ limitations under the License.
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"os"
|
||||
|
||||
"github.com/spf13/pflag"
|
||||
@ -29,10 +30,15 @@ import (
|
||||
|
||||
func main() {
|
||||
klog.InitFlags(nil)
|
||||
arguments := args.Default()
|
||||
arguments := args.Default().WithoutDefaultFlagParsing()
|
||||
|
||||
pflag.CommandLine.BoolVar(&arguments.IncludeTestFiles, "include-test-files", false, "If true, include *_test.go files.")
|
||||
|
||||
// Collect and parse flags.
|
||||
arguments.AddFlags(pflag.CommandLine)
|
||||
pflag.CommandLine.AddGoFlagSet(flag.CommandLine)
|
||||
pflag.Parse()
|
||||
|
||||
if err := arguments.Execute(
|
||||
generators.NameSystems(),
|
||||
generators.DefaultNameSystem(),
|
||||
|
Loading…
Reference in New Issue
Block a user