Skip to content

Commit

Permalink
Fix stdin mode in chroma tool.
Browse files Browse the repository at this point in the history
Fixes #207.
  • Loading branch information
alecthomas committed Dec 13, 2018
1 parent 3175fa5 commit 3b3f74c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions cmd/chroma/main.go
Expand Up @@ -3,7 +3,6 @@ package main
import (
"bufio"
"fmt"
"github.com/alecthomas/kong"
"io"
"io/ioutil"
"os"
Expand All @@ -14,13 +13,15 @@ import (
"strconv"
"strings"

"github.com/alecthomas/kong"
colorable "github.com/mattn/go-colorable"
isatty "github.com/mattn/go-isatty"

"github.com/alecthomas/chroma"
"github.com/alecthomas/chroma/formatters"
"github.com/alecthomas/chroma/formatters/html"
"github.com/alecthomas/chroma/lexers"
"github.com/alecthomas/chroma/styles"
"github.com/mattn/go-colorable"
"github.com/mattn/go-isatty"
)

var (
Expand Down Expand Up @@ -63,7 +64,7 @@ command, for Go.
HTMLBaseLine int `help:"Base line number." default:"1"`
HTMLPreventSurroundingPre bool `help:"Prevent the surrounding pre tag."`

Files []string `arg:"" help:"Files to highlight." type:"existingfile"`
Files []string `arg:"" optional:"" help:"Files to highlight." type:"existingfile"`
}
)

Expand All @@ -79,7 +80,7 @@ func (n *nopFlushableWriter) Flush() error { return nil }
func main() {
ctx := kong.Parse(&cli, kong.Description(description), kong.Vars{
"version": fmt.Sprintf("%s-%s-%s", version, commit, date),
}, )
})
if cli.List {
listAll()
return
Expand Down

0 comments on commit 3b3f74c

Please sign in to comment.