| ... | ... | @@ -98,6 +98,7 @@ const normal_usage = |
| 98 | 98 | \\ |
| 99 | 99 | \\ env Print lib path, std path, cache directory, and version |
| 100 | 100 | \\ help Print this help and exit |
| 101 | \\ std View standard library documentation in a browser |
| 101 | 102 | \\ libc Display native libc paths file or validate one |
| 102 | 103 | \\ targets List available compilation targets |
| 103 | 104 | \\ version Print version number and exit |
| ... | ... | @@ -309,6 +310,14 @@ fn mainArgs(gpa: Allocator, arena: Allocator, args: []const []const u8) !void { |
| 309 | 310 | .root_src_path = "libc.zig", |
| 310 | 311 | .prepend_zig_lib_dir_path = true, |
| 311 | 312 | }); |
| 313 | } else if (mem.eql(u8, cmd, "std")) { |
| 314 | return jitCmd(gpa, arena, cmd_args, .{ |
| 315 | .cmd_name = "std", |
| 316 | .root_src_path = "std-docs.zig", |
| 317 | .prepend_zig_lib_dir_path = true, |
| 318 | .prepend_zig_exe_path = true, |
| 319 | .prepend_global_cache_path = true, |
| 320 | }); |
| 312 | 321 | } else if (mem.eql(u8, cmd, "init")) { |
| 313 | 322 | return cmdInit(gpa, arena, cmd_args); |
| 314 | 323 | } else if (mem.eql(u8, cmd, "targets")) { |
| ... | ... | @@ -5556,6 +5565,8 @@ const JitCmdOptions = struct { |
| 5556 | 5565 | cmd_name: []const u8, |
| 5557 | 5566 | root_src_path: []const u8, |
| 5558 | 5567 | prepend_zig_lib_dir_path: bool = false, |
| 5568 | prepend_global_cache_path: bool = false, |
| 5569 | prepend_zig_exe_path: bool = false, |
| 5559 | 5570 | depend_on_aro: bool = false, |
| 5560 | 5571 | capture: ?*[]u8 = null, |
| 5561 | 5572 | }; |
| ... | ... | @@ -5714,6 +5725,10 @@ fn jitCmd( |
| 5714 | 5725 | |
| 5715 | 5726 | if (options.prepend_zig_lib_dir_path) |
| 5716 | 5727 | child_argv.appendAssumeCapacity(zig_lib_directory.path.?); |
| 5728 | if (options.prepend_zig_exe_path) |
| 5729 | child_argv.appendAssumeCapacity(self_exe_path); |
| 5730 | if (options.prepend_global_cache_path) |
| 5731 | child_argv.appendAssumeCapacity(global_cache_directory.path.?); |
| 5717 | 5732 | |
| 5718 | 5733 | child_argv.appendSliceAssumeCapacity(args); |
| 5719 | 5734 | |