diff --git a/cmd/tar-split/disasm.go b/cmd/tar-split/disasm.go index b7b0dfe..7f8a056 100644 --- a/cmd/tar-split/disasm.go +++ b/cmd/tar-split/disasm.go @@ -3,6 +3,7 @@ package main import ( "compress/gzip" "io" + "io/ioutil" "os" "github.com/Sirupsen/logrus" @@ -48,7 +49,13 @@ func CommandDisasm(c *cli.Context) { if err != nil { logrus.Fatal(err) } - i, err := io.Copy(os.Stdout, its) + var out io.Writer + if c.Bool("no-stdout") { + out = ioutil.Discard + } else { + out = os.Stdout + } + i, err := io.Copy(out, its) if err != nil { logrus.Fatal(err) } diff --git a/cmd/tar-split/main.go b/cmd/tar-split/main.go index b417120..c584352 100644 --- a/cmd/tar-split/main.go +++ b/cmd/tar-split/main.go @@ -42,6 +42,10 @@ func main() { Value: "tar-data.json.gz", Usage: "output of disassembled tar stream", }, + cli.BoolFlag{ + Name: "no-stdout", + Usage: "do not throughput the stream to STDOUT", + }, }, }, {