]> Sergey Matveev's repositories - tofuproxy.git/blobdiff - cmd/warc-extract/main.go
Redundant return
[tofuproxy.git] / cmd / warc-extract / main.go
index 560aefa2d62e815d8518fee0d38e27db49ee129a..abb1618ea40a1faae7489d672eb03f5d70576a0b 100644 (file)
@@ -1,6 +1,6 @@
 /*
 warc-extract -- WARC files data extractor
-Copyright (C) 2021-2022 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2021-2023 Sergey Matveev <stargrave@stargrave.org>
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -34,10 +34,12 @@ import (
 func main() {
        uri := flag.String("uri", "", "URI to extract, if specified")
        hdr := flag.Bool("hdr", false, "Also extract WARC's header")
-       idx := flag.Bool("idx", false, "Save WARC indexes")
+       idx := flag.Bool("idx", false, "Save WARC indices")
        recompress := flag.Bool("for-enzstd", false, "Output for enzstd utility")
+       unzstdPath := flag.String("unzstd", "cmd/zstd/unzstd", "Path to unzstd utility")
        flag.Parse()
        log.SetFlags(log.Lshortfile)
+       warc.UnZSTDPath = *unzstdPath
 
        if *recompress {
                var hdr bytes.Buffer
@@ -89,7 +91,7 @@ func main() {
                }
                log.Println("added", p, len(warc.WARCs[p]), "URIs")
                if *idx {
-                       if err := warc.SaveIndexes(); err != nil {
+                       if err := warc.SaveIndices(); err != nil {
                                log.Fatalln(err)
                        }
                }
@@ -117,5 +119,4 @@ func main() {
                        io.Copy(os.Stdout, r)
                }
        }
-       return
 }