commit 3b65a1d7ef7e9a1db9ee7f142476926cf745ee76
parent fce4379f46d7b5e1d941d8828c45339da73ea176
Author: Alexey Yerin <yyp@disroot.org>
Date: Mon, 2 May 2022 22:53:54 +0300
cmd/hare: display "(root)" instead of empty namespace
Signed-off-by: Alexey Yerin <yyp@disroot.org>
Diffstat:
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/cmd/hare/schedule.ha b/cmd/hare/schedule.ha
@@ -167,6 +167,8 @@ fn sched_hare_object(
};
const ns = unparse::identstr(namespace);
+ const displayed_ns = if (len(ns) == 0) "(root)" else ns;
+
let ssa = mkfile(plan, ns, "ssa");
let harec = alloc(task {
status = status::SCHEDULED,
@@ -208,8 +210,8 @@ fn sched_hare_object(
let manifest = match (module::manifest_load(
plan.context, namespace)) {
case let err: module::error =>
- fmt::fatalf("Error reading cache entry for {}: {}", ns,
- module::strerror(err));
+ fmt::fatalf("Error reading cache entry for {}: {}",
+ displayed_ns, module::strerror(err));
case let m: module::manifest =>
yield m;
};
@@ -255,7 +257,8 @@ fn sched_hare_object(
};
};
if (hare_inputs == 0) {
- fmt::fatalf("Error: Module {} has no Hare input files", ns);
+ fmt::fatalf("Error: Module {} has no Hare input files",
+ displayed_ns);
};
if (current) {