main: compare two files with two -f flags

Fixes: #159

```shell
vbatts@fogel:~/src/github.com/vbatts/go-mtree$ ./gomtree -c -f foo
vbatts@fogel:~/src/github.com/vbatts/go-mtree$ ./gomtree -c -f bar -K sha256
vbatts@fogel:~/src/github.com/vbatts/go-mtree$ ./gomtree -f foo -f bar
"foo": unexpected path
".": keyword "time": expected 1649109728.228935367; got 1649109734.412959677
FATA[0000] manifest validation failed
vbatts@fogel:~/src/github.com/vbatts/go-mtree$ echo $?
1
```

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2022-04-04 17:43:17 -04:00
parent bdace0aacf
commit b5e683dfc9
Signed by: vbatts
GPG Key ID: 10937E57733F1362
1 changed files with 11 additions and 0 deletions

View File

@ -294,6 +294,17 @@ func mainApp(c *cli.Context) error {
if err != nil {
return err
}
} else if len(c.StringSlice("file")) > 1 {
// load this second hierarchy file provided
fh, err := os.Open(c.StringSlice("file")[1])
if err != nil {
return err
}
stateDh, err = mtree.ParseSpec(fh)
fh.Close()
if err != nil {
return err
}
} else {
// with a root directory
stateDh, err = mtree.Walk(rootPath, excludes, currentKeywords, nil)