Skip to content

Commit

Permalink
show '-' as filename for piped input
Browse files Browse the repository at this point in the history
  • Loading branch information
martinlindhe committed Jan 8, 2018
1 parent 49fbbe5 commit 6410788
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down

0 comments on commit 6410788

Please sign in to comment.