diff options
| author | Nick White <git@njw.name> | 2020-05-26 16:03:12 +0100 | 
|---|---|---|
| committer | Nick White <git@njw.name> | 2020-05-26 16:03:12 +0100 | 
| commit | ebc27eef77868fa44daed7cfb0ea129690029da8 (patch) | |
| tree | c8f461ba1b829ce4d91d6eb90fd7d34f1e086845 /cmd/getpipelinebook | |
| parent | ed561822b58756c101654946cff0617a6038bc2c (diff) | |
Add -c conntype for necessary tools to allow local connection to be used
Diffstat (limited to 'cmd/getpipelinebook')
| -rw-r--r-- | cmd/getpipelinebook/main.go | 12 | 
1 files changed, 10 insertions, 2 deletions
diff --git a/cmd/getpipelinebook/main.go b/cmd/getpipelinebook/main.go index dc9387f..03e709b 100644 --- a/cmd/getpipelinebook/main.go +++ b/cmd/getpipelinebook/main.go @@ -17,7 +17,7 @@ import (  	"rescribe.xyz/bookpipeline"  ) -const usage = `Usage: getpipelinebook [-a] [-graph] [-pdf] [-png] [-v] bookname +const usage = `Usage: getpipelinebook [-c conn] [-a] [-graph] [-pdf] [-png] [-v] bookname  Downloads the pipeline results for a book. @@ -57,6 +57,7 @@ func getpdfs(conn Pipeliner, l *log.Logger, bookname string) {  func main() {  	all := flag.Bool("a", false, "Get all files for book") +	conntype := flag.String("c", "aws", "connection type ('aws' or 'local')")  	graph := flag.Bool("graph", false, "Only download graphs (can be used alongside -pdf)")  	binarisedpdf := flag.Bool("binarisedpdf", false, "Only download binarised PDF (can be used alongside -graph)")  	colourpdf := flag.Bool("colourpdf", false, "Only download colour PDF (can be used alongside -graph)") @@ -83,7 +84,14 @@ func main() {  	}  	var conn Pipeliner -	conn = &bookpipeline.AwsConn{Region: "eu-west-2", Logger: verboselog} +	switch *conntype { +	case "aws": +		conn = &bookpipeline.AwsConn{Region: "eu-west-2", Logger: verboselog} +	case "local": +		conn = &bookpipeline.LocalConn{Logger: verboselog} +	default: +		log.Fatalln("Unknown connection type") +	}  	verboselog.Println("Setting up AWS session")  	err := conn.MinimalInit()  | 
