authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-10-15 17:42:19-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-10-15 17:44:10-07:00
log09a250c531afb95f475d6834a50f1aecc4761b39
tree4289a3e3243c60354a0fa25f44065516823e4648
parentdfce396cf865e5cc05f46f3079e25c5acb98a4c3

adjust error message of zig run with no args

previously it said "one source file" which was not correct

1 files changed, 5 insertions(+), 3 deletions(-)

src/main.zig+5-3
......@@ -1266,11 +1266,13 @@ fn buildOutputType(
12661266 }
12671267
12681268 if (root_src_file == null and arg_mode == .zig_test) {
1269 fatal("one zig source file is required to run `zig test`", .{});
1269 fatal("`zig test` expects a zig source file argument", .{});
12701270 }
12711271
1272 if (link_objects.items.len == 0 and root_src_file == null and c_source_files.items.len == 0 and arg_mode == .run) {
1273 fatal("one source file is required to run `zig run`", .{});
1272 if (link_objects.items.len == 0 and root_src_file == null and
1273 c_source_files.items.len == 0 and arg_mode == .run)
1274 {
1275 fatal("`zig run` expects at least one positional argument", .{});
12741276 }
12751277
12761278 const root_name = if (provided_name) |n| n else blk: {