Skip to content

Commit

Permalink
Include filename in bebopc read file failures
Browse files Browse the repository at this point in the history
  • Loading branch information
200sc committed Dec 22, 2020
1 parent b68cbf7 commit fe830ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions main/bebopc-go/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"flag"
"fmt"
"os"
"path/filepath"

"github.com/200sc/bebop"
)
Expand All @@ -15,7 +16,7 @@ var printHelp = flag.Bool("help", false, "print usage text")
var packageName = flag.String("package", "bebopgen", "specify the name of the package to generate")
var generateUnsafeMethods = flag.Bool("generate-unsafe", false, "whether unchecked additional methods should be generated")

const version = "bebopc-go v0.0.6"
const version = "bebopc-go v0.0.7"

func main() {
err := run()
Expand Down Expand Up @@ -49,7 +50,8 @@ func run() error {
defer f.Close()
bopf, err := bebop.ReadFile(f)
if err != nil {
return fmt.Errorf("failed to read input file: %w", err)
filename := filepath.Base(*inputFile)
return fmt.Errorf("parsing input failed: %s%w", filename, err)
}
out, err := os.Create(*outputFile)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion main/bebopfmt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var writeInPlace = flag.Bool("w", false, "rewrite the file in place instead of p
var printVersion = flag.Bool("version", false, "print the version of bebopfmt")
var printHelp = flag.Bool("help", false, "print usage text")

const version = "bebopfmt v0.0.6"
const version = "bebopfmt v0.0.7"

func main() {
err := run()
Expand Down

0 comments on commit fe830ed

Please sign in to comment.