~kota/gemgen

0cd9c9a8b398b072a52ad3241f195d441c3ee2bc — Michelle S 2 years ago ab4cde9
Fix reading from standard input, writing to standard output

`options.ParseArgs` returns [] for opts if no files are specified, not
`nil`.  This commit changes the relevant logic to check for that,
allowing reading from standard input and writing to standard output.
1 files changed, 1 insertions(+), 1 deletions(-)

M main.go
M main.go => main.go +1 -1
@@ 35,7 35,7 @@ func main() {
	}

	// Use stdin if no filenames were given.
	if opts.Names == nil {
	if len(opts.Names) == 0 {
		err = Convert(os.Stdin, os.Stdout, opts.GemOptions)
		if err != nil {
			log.Fatalf("failed converting STDIN: %v\n", err)