diff options
Diffstat (limited to 'src/cli.zig')
-rw-r--r-- | src/cli.zig | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/cli.zig b/src/cli.zig index 88b6aa057..0fb618afc 100644 --- a/src/cli.zig +++ b/src/cli.zig @@ -161,7 +161,8 @@ pub const Arguments = struct { clap.parseParam("--no-macros Disable macros from being executed in the bundler, transpiler and runtime") catch unreachable, clap.parseParam("--target <STR> The intended execution environment for the bundle. \"browser\", \"bun\" or \"node\"") catch unreachable, clap.parseParam("--inspect <STR>? Activate Bun's Debugger") catch unreachable, - clap.parseParam("--inspect-wait <STR>? Activate Bun's Debugger and wait for a connection before executing") catch unreachable, + clap.parseParam("--inspect-wait <STR>? Activate Bun's Debugger, wait for a connection before executing") catch unreachable, + clap.parseParam("--inspect-brk <STR>? Activate Bun's Debugger, set breakpoint on first line of code and wait") catch unreachable, clap.parseParam("<POS>... ") catch unreachable, }; @@ -530,6 +531,18 @@ pub const Arguments = struct { .path_or_port = inspect_flag, .wait_for_connection = true, } }; + } else if (args.option("--inspect-brk")) |inspect_flag| { + ctx.runtime_options.debugger = if (inspect_flag.len == 0) + Command.Debugger{ .enable = .{ + .wait_for_connection = true, + .set_breakpoint_on_first_line = true, + } } + else + Command.Debugger{ .enable = .{ + .path_or_port = inspect_flag, + .wait_for_connection = true, + .set_breakpoint_on_first_line = true, + } }; } } @@ -969,6 +982,7 @@ pub const Command = struct { enable: struct { path_or_port: []const u8 = "", wait_for_connection: bool = false, + set_breakpoint_on_first_line: bool = false, }, }; |