show '-' as filename for piped input

This commit is contained in:
Martin Lindhe 2018-01-08 01:23:25 +01:00
parent 49fbbe5545
commit 6410788705

View file

@ -27,15 +27,20 @@ func main() {
os.Exit(1)
}
filename := "-"
if *inFile != "" {
filename = *inFile
}
var f interface{}
_, err = toml.Decode(string(data), &f)
if err != nil {
fmt.Println("ERROR:", *inFile, err)
fmt.Println("ERROR:", filename, err)
os.Exit(1)
}
if !*quiet {
fmt.Println("OK:", *inFile)
fmt.Println("OK:", filename)
}
}