diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-12-12 15:33:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-12 15:33:30 +0100 |
commit | 4a17c930882c5765e5fdedb50b6493469f61e32d (patch) | |
tree | 91f7157b871ee5d2414018586fc1e3a335963d53 /cli/args/mod.rs | |
parent | a2db70a8d0820722695e9094c8dbc888bde1ffa3 (diff) |
feat: add `--inspect-wait` flag (#17001)
This commit adds new "--inspect-wait" flag which works similarly
to "--inspect-brk" in that it waits for inspector session to be
established before running code. However it doesn't break on the first
statement of user code, but instead runs it as soon as a session
is established.
Diffstat (limited to 'cli/args/mod.rs')
-rw-r--r-- | cli/args/mod.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/cli/args/mod.rs b/cli/args/mod.rs index ebe71c7fa..de5725a48 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -341,7 +341,11 @@ impl CliOptions { } pub fn resolve_inspector_server(&self) -> Option<InspectorServer> { - let maybe_inspect_host = self.flags.inspect.or(self.flags.inspect_brk); + let maybe_inspect_host = self + .flags + .inspect + .or(self.flags.inspect_brk) + .or(self.flags.inspect_wait); maybe_inspect_host .map(|host| InspectorServer::new(host, version::get_user_agent())) } @@ -466,13 +470,19 @@ impl CliOptions { /// If the --inspect or --inspect-brk flags are used. pub fn is_inspecting(&self) -> bool { - self.flags.inspect.is_some() || self.flags.inspect_brk.is_some() + self.flags.inspect.is_some() + || self.flags.inspect_brk.is_some() + || self.flags.inspect_wait.is_some() } pub fn inspect_brk(&self) -> Option<SocketAddr> { self.flags.inspect_brk } + pub fn inspect_wait(&self) -> Option<SocketAddr> { + self.flags.inspect_wait + } + pub fn log_level(&self) -> Option<log::Level> { self.flags.log_level } |