show '-' as filename for piped input
This commit is contained in:
parent
49fbbe5545
commit
6410788705
1 changed files with 7 additions and 2 deletions
9
main.go
9
main.go
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue