mirror of
https://github.com/ziglang/zig.git
synced 2025-12-24 07:03:11 +00:00
friendly error message for zig run with no args
This commit is contained in:
parent
e892ee17e6
commit
dfce396cf8
@ -1269,6 +1269,10 @@ fn buildOutputType(
|
||||
fatal("one zig source file is required to run `zig test`", .{});
|
||||
}
|
||||
|
||||
if (link_objects.items.len == 0 and root_src_file == null and c_source_files.items.len == 0 and arg_mode == .run) {
|
||||
fatal("one source file is required to run `zig run`", .{});
|
||||
}
|
||||
|
||||
const root_name = if (provided_name) |n| n else blk: {
|
||||
if (arg_mode == .zig_test) {
|
||||
break :blk "test";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user