aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/mbf/main.go18
1 files changed, 15 insertions, 3 deletions
diff --git a/cmd/mbf/main.go b/cmd/mbf/main.go
index cc8a40b2..8e2c4bda 100644
--- a/cmd/mbf/main.go
+++ b/cmd/mbf/main.go
@@ -64,11 +64,12 @@ func main() {
return
}
- e, ok := r.(rosa.LoadError)
- if !ok {
+ switch r.(type) {
+ case rosa.LoadError, pkg.IRStringError:
+ log.Fatal(r)
+ default:
panic(r)
}
- log.Fatal(e)
}()
ctx, stop := signal.NotifyContext(context.Background(),
@@ -86,6 +87,7 @@ func main() {
flagLTO bool
flagPT bool
+ flagSourcePath string
flagCrossOverride int
addr net.UnixAddr
@@ -136,6 +138,12 @@ func main() {
}
}
+ if flagSourcePath != "" {
+ if err := rosa.Native().SetSource(os.DirFS(flagSourcePath)); err != nil {
+ return err
+ }
+ }
+
return nil
}).Flag(
&flagQuiet,
@@ -196,6 +204,10 @@ func main() {
&flagPT,
"parse-time", command.BoolFlag(false),
"Print duration of the initial azalea parse",
+ ).Flag(
+ &flagSourcePath,
+ "source", command.StringFlag(""),
+ "Override hakurei source tree",
)
c.NewCommand(