Patrick Georgi has uploaded this change for review. ( https://review.coreboot.org/29606
Change subject: util/scripts/maintainers.go: Introduce command line argument handling ......................................................................
util/scripts/maintainers.go: Introduce command line argument handling
First new option is -debug.
Change-Id: Ia6e9b3675449a0b1e6f5d7526ee999f925eaadb2 Signed-off-by: Patrick Georgi pgeorgi@google.com --- M util/scripts/maintainers.go 1 file changed, 20 insertions(+), 24 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/06/29606/1
diff --git a/util/scripts/maintainers.go b/util/scripts/maintainers.go index 843a794..6d91b90 100644 --- a/util/scripts/maintainers.go +++ b/util/scripts/maintainers.go @@ -15,6 +15,7 @@
import ( "bufio" + "flag" "fmt" "log" "os" @@ -287,11 +288,24 @@
func main() { var files []string - var maint bool - var debug bool var err error
- args := os.Args[1:] + var debug = flag.Bool("debug", false, "emit additional debug output") + flag.Parse() + + /* get and build subsystem database */ + maintainers, err := get_maintainers() + if err != nil { + log.Fatalf("Oops.") + return + } + build_maintainers(maintainers) + + if *debug { + print_maintainers() + } + + args := flag.Args() if len(args) == 0 { /* get the filenames */ files, err = get_git_files() @@ -299,33 +313,15 @@ log.Fatalf("Oops.") return } - maint = false + for _, file := range files { + find_unmaintained(file) + } } else { files = args - maint = true - }
- maintainers, err := get_maintainers() - if err != nil { - log.Fatalf("Oops.") - return - } - - /* build subsystem database */ - build_maintainers(maintainers) - - if debug { - print_maintainers() - } - - if maint { /* Find maintainers for each file */ for _, file := range files { find_maintainer(file) } - } else { - for _, file := range files { - find_unmaintained(file) - } } }