1
0
Fork 0
forked from mirrors/tar-split

cmd: add a disasm --no-stdout flag

Since sometimes you just need to > /dev/null

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2016-06-26 10:15:12 -04:00
parent e2a62d6b0d
commit 354fd6cf34
2 changed files with 12 additions and 1 deletions

View file

@ -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)
}

View file

@ -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",
},
},
},
{