From 14c9274513b6949fb32d7373c43530c6b15c8e85 Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Sat, 15 May 2021 00:42:28 +0200 Subject: add -q flag --- python/notes/version_3.md | 8 ++++++++ skate/cmd/skate-reduce/main.go | 7 +++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/python/notes/version_3.md b/python/notes/version_3.md index c2cdc60..f828ee8 100644 --- a/python/notes/version_3.md +++ b/python/notes/version_3.md @@ -308,3 +308,11 @@ So maybe 500k isbn in total? * about 25M urls * about 11075871 seem to have a "doi" + +---- + +A subtle bug: a doi in refs ends with tab: + +``` +10.1002/andp.19975090102\t +``` diff --git a/skate/cmd/skate-reduce/main.go b/skate/cmd/skate-reduce/main.go index 959dd87..6c69121 100644 --- a/skate/cmd/skate-reduce/main.go +++ b/skate/cmd/skate-reduce/main.go @@ -40,6 +40,7 @@ package main import ( "bufio" "flag" + "io/ioutil" "log" "os" "runtime" @@ -53,6 +54,7 @@ var ( numWorkers = flag.Int("w", runtime.NumCPU(), "number of workers") batchSize = flag.Int("b", 10000, "batch size") mode = flag.String("m", "ref", "mode, e.g. exact, verify, ref, bref, wiki") + quite = flag.Bool("q", false, "be quite") // Possible inputs -- we could switch to a subcommand cli parser? refs = flag.String("F", "", "path to refs input") @@ -72,10 +74,11 @@ var ( func main() { flag.Parse() - + if *quite { + log.SetOutput(ioutil.Discard) + } bw := bufio.NewWriter(os.Stdout) defer bw.Flush() - switch *mode { case "exact": l, f, err := xio.OpenTwo(*releases, *refs) -- cgit v1.2.3