| ... | @@ -1266,20 +1266,6 @@ fn buildOutputType( | ... | @@ -1266,20 +1266,6 @@ fn buildOutputType( |
| 1266 | fatal("`zig test` expects a zig source file argument", .{}); | 1266 | fatal("`zig test` expects a zig source file argument", .{}); |
| 1267 | } | 1267 | } |
| 1268 | | 1268 | |
| 1269 | if (link_objects.items.len == 0 and root_src_file == null and | | |
| 1270 | c_source_files.items.len == 0 and !show_builtin) | | |
| 1271 | { | | |
| 1272 | switch (arg_mode) { | | |
| 1273 | .run => fatal("`zig run` expects at least one positional argument", .{}), | | |
| 1274 | .build => |build_type| switch (build_type) { | | |
| 1275 | .Exe => fatal("`zig build-exe` expects at least one positional argument", .{}), | | |
| 1276 | .Lib => fatal("`zig build-lib` expects at least one positional argument", .{}), | | |
| 1277 | .Obj => fatal("`zig build-obj` expects at least one positional argument", .{}), | | |
| 1278 | }, | | |
| 1279 | else => {}, | | |
| 1280 | } | | |
| 1281 | } | | |
| 1282 | | | |
| 1283 | const root_name = if (provided_name) |n| n else blk: { | 1269 | const root_name = if (provided_name) |n| n else blk: { |
| 1284 | if (arg_mode == .zig_test) { | 1270 | if (arg_mode == .zig_test) { |
| 1285 | break :blk "test"; | 1271 | break :blk "test"; |
| ... | @@ -1298,9 +1284,12 @@ fn buildOutputType( | ... | @@ -1298,9 +1284,12 @@ fn buildOutputType( |
| 1298 | } else if (show_builtin) { | 1284 | } else if (show_builtin) { |
| 1299 | break :blk "builtin"; | 1285 | break :blk "builtin"; |
| 1300 | } else if (arg_mode == .run) { | 1286 | } else if (arg_mode == .run) { |
| 1301 | break :blk "run"; | 1287 | fatal("`zig run` expects at least one positional argument", .{}); |
| | 1288 | // TODO once the attempt to unwrap error: LinkingWithoutZigSourceUnimplemented |
| | 1289 | // is solved, remove the above fatal() and uncomment the `break` below. |
| | 1290 | //break :blk "run"; |
| 1302 | } else { | 1291 | } else { |
| 1303 | fatal("--name [name] not provided and unable to infer", .{}); | 1292 | fatal("expected a positional argument, -femit-bin=[path], --show-builtin, or --name [name]", .{}); |
| 1304 | } | 1293 | } |
| 1305 | }; | 1294 | }; |
| 1306 | | 1295 | |