aboutsummaryrefslogtreecommitdiff
path: root/steam-export-cli.go
diff options
context:
space:
mode:
authorMitch Riedstra <mitch@riedstra.us>2017-01-16 21:08:10 -0500
committerMitch Riedstra <mitch@riedstra.us>2017-01-16 21:08:10 -0500
commit26fdb68fbb1fadf8a917bdf5734af05d93bda2a0 (patch)
treec89c59ab107d2f5c1f40eecebb84d12afbf430f1 /steam-export-cli.go
parentd4237470e32ce36dd7e0ea88cc274ec5311d69cc (diff)
downloadsteam-export-26fdb68fbb1fadf8a917bdf5734af05d93bda2a0.tar.gz
steam-export-26fdb68fbb1fadf8a917bdf5734af05d93bda2a0.tar.xz
Add support for gzipped archives
Diffstat (limited to 'steam-export-cli.go')
-rw-r--r--steam-export-cli.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/steam-export-cli.go b/steam-export-cli.go
index 3b9d607..23857e0 100644
--- a/steam-export-cli.go
+++ b/steam-export-cli.go
@@ -91,6 +91,8 @@ func packageGame(args []string) error {
"Name of the archive file to be created. Please do not include the file extension")
game := fl.Int("g", -1,
"Index of the game to be exported. Please see `list` for the index")
+ compress := fl.String("z", "gz",
+ "Compression type. Default 'gz' '' is no compression")
var g int
l := steam.DefaultLib
@@ -112,7 +114,12 @@ func packageGame(args []string) error {
fileName = &steamLib.Games[g]
}
- return steamLib.PackageGameToFile(g, *fileName+".tar")
+ switch *compress {
+ case "gz":
+ return steamLib.PackageGameToFile(g, *fileName+".tar.gz", *compress)
+ default:
+ return steamLib.PackageGameToFile(g, *fileName+".tar", *compress)
+ }
}
@@ -122,6 +129,8 @@ func extractGame(args []string) error {
"Path to library in question. All the way to the 'steamapps' folder")
fileName := fl.String("f", "",
"Name of the archive file to be extracted. Please include the file extension")
+ compress := fl.String("z", "gz",
+ "Compression type. Default 'gz' '' is no compression")
l := steam.DefaultLib
fl.Parse(args)
@@ -137,7 +146,7 @@ func extractGame(args []string) error {
return errors.New("No filename provided")
}
- return steamLib.ExtractGameFromFile(*fileName)
+ return steamLib.ExtractGameFromFile(*fileName, *compress)
}