-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
42 lines (34 loc) · 1.03 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
SPDX-License-Identifier: Apache-2.0
Copyright 2015 The Kubernetes Authors.
Copyright 2019 Wind River Systems, Inc.
*/
// deepequal-gen is a tool for auto-generating DeepEqual functions. Refer to
// the README.md file for more information
package main
import (
"github.com/wind-river/deepequal-gen/generators"
"k8s.io/gengo/args"
"github.com/spf13/pflag"
"k8s.io/klog"
)
func main() {
klog.InitFlags(nil)
arguments := args.Default()
// Override defaults.
arguments.OutputFileBaseName = "deepequal_generated"
// Custom args.
customArgs := &generators.CustomArgs{}
pflag.CommandLine.StringSliceVar(&customArgs.BoundingDirs, "bounding-dirs", customArgs.BoundingDirs,
"Comma-separated list of import paths which bound the types for which deep-copies will be generated.")
arguments.CustomArgs = customArgs
// Run it.
if err := arguments.Execute(
generators.NameSystems(),
generators.DefaultNameSystem(),
generators.Packages,
); err != nil {
klog.Fatalf("Error: %v", err)
}
klog.V(2).Info("Completed successfully.")
}