summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/getpipelinebook/main.go17
1 files changed, 15 insertions, 2 deletions
diff --git a/cmd/getpipelinebook/main.go b/cmd/getpipelinebook/main.go
index f0dd4cf..f1092f8 100644
--- a/cmd/getpipelinebook/main.go
+++ b/cmd/getpipelinebook/main.go
@@ -16,7 +16,7 @@ import (
"rescribe.xyz/bookpipeline"
)
-const usage = `Usage: getpipelinebook [-a] [-pdf] [-png] [-v] bookname
+const usage = `Usage: getpipelinebook [-a] [-graph] [-pdf] [-png] [-v] bookname
Downloads the pipeline results for a book.
@@ -56,7 +56,8 @@ func getpdfs(conn Pipeliner, l *log.Logger, bookname string) {
func main() {
all := flag.Bool("a", false, "Get all files for book")
- pdf := flag.Bool("pdf", false, "Only download PDFs")
+ graph := flag.Bool("graph", false, "Only download graphs (can be used alongside -pdf)")
+ pdf := flag.Bool("pdf", false, "Only download PDFs (can be used alongside -graph)")
png := flag.Bool("png", false, "Only download best binarised png files")
verbose := flag.Bool("v", false, "Verbose")
flag.Usage = func() {
@@ -113,6 +114,18 @@ func main() {
if *pdf {
getpdfs(conn, verboselog, bookname)
+ }
+
+ if *graph {
+ fn := filepath.Join(bookname, "graph.png")
+ verboselog.Println("Downloading file", fn)
+ err = conn.Download(conn.WIPStorageId(), fn, fn)
+ if err != nil {
+ log.Fatalln("Failed to download file", fn, err)
+ }
+ }
+
+ if *pdf || *graph {
return
}