aboutsummaryrefslogtreecommitdiffstats
path: root/skate/cmd
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2021-05-19 01:35:17 +0200
committerMartin Czygan <martin.czygan@gmail.com>2021-05-19 01:35:17 +0200
commit936aec757ead25829b8f034def66dbf4adb7707b (patch)
tree7c0c5fd6d0c34829bf06052e3b2a3055cd0d9db7 /skate/cmd
parent024132dfb8617fbc255e0423319e8692a6867370 (diff)
downloadrefcat-936aec757ead25829b8f034def66dbf4adb7707b.tar.gz
refcat-936aec757ead25829b8f034def66dbf4adb7707b.zip
do not fail on partial input; extend logging
Diffstat (limited to 'skate/cmd')
-rw-r--r--skate/cmd/skate-reduce/main.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/skate/cmd/skate-reduce/main.go b/skate/cmd/skate-reduce/main.go
index 6c69121..eb84e38 100644
--- a/skate/cmd/skate-reduce/main.go
+++ b/skate/cmd/skate-reduce/main.go
@@ -55,6 +55,7 @@ var (
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")
+ logFile = flag.String("log", "", "log filename")
// Possible inputs -- we could switch to a subcommand cli parser?
refs = flag.String("F", "", "path to refs input")
@@ -74,6 +75,14 @@ var (
func main() {
flag.Parse()
+ if *logFile != "" {
+ f, err := os.OpenFile(*logFile, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
+ if err != nil {
+ log.Fatal(err)
+ }
+ defer f.Close()
+ log.SetOutput(f)
+ }
if *quite {
log.SetOutput(ioutil.Discard)
}