Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions md2man.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ func main() {
flag.Parse()

inFile := os.Stdin
if *inFilePath != "" {
if *inFilePath != "" && *inFilePath != "-" {
inFile, err = os.Open(*inFilePath)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
defer inFile.Close() // nolint: errcheck
}
defer inFile.Close() // nolint: errcheck

doc, err := ioutil.ReadAll(inFile)
if err != nil {
Expand All @@ -35,7 +35,7 @@ func main() {
out := md2man.Render(doc)

outFile := os.Stdout
if *outFilePath != "" {
if *outFilePath != "" && *outFilePath != "-" {
outFile, err = os.Create(*outFilePath)
if err != nil {
fmt.Println(err)
Expand Down