diff --git a/cmd/tar-split/asm.go b/cmd/tar-split/asm.go index 7665f95..fb77df4 100644 --- a/cmd/tar-split/asm.go +++ b/cmd/tar-split/asm.go @@ -37,6 +37,12 @@ func CommandAsm(c *cli.Context) { outputStream = fh } + if c.Bool("compress") { + zipper := gzip.NewWriter(outputStream) + defer zipper.Close() + outputStream = zipper + } + // Get the tar metadata reader mf, err := os.Open(c.String("input")) if err != nil { diff --git a/cmd/tar-split/main.go b/cmd/tar-split/main.go index 5f039ab..37e0f64 100644 --- a/cmd/tar-split/main.go +++ b/cmd/tar-split/main.go @@ -69,6 +69,11 @@ func main() { Value: "", Usage: "relative path of extracted tar", }, + cli.BoolFlag{ + Name: "compress", + Usage: "gzip compress the output", + // defaults to false + }, }, }, {