Add debug only guard for the --wait-dbg flag
This commit is contained in:
@@ -52,7 +52,8 @@ FLAGS:
|
|||||||
--log-file <PATH> Log to the specified file instead of stderr
|
--log-file <PATH> Log to the specified file instead of stderr
|
||||||
--no-buffering Flush log records to the file immediately
|
--no-buffering Flush log records to the file immediately
|
||||||
|
|
||||||
--wait-dbg Wait until a debugger is attached to
|
--wait-dbg Wait until a debugger is attached to.
|
||||||
|
The flag is valid for debug builds only
|
||||||
|
|
||||||
ENVIRONMENTAL VARIABLES:
|
ENVIRONMENTAL VARIABLES:
|
||||||
RA_LOG Set log filter in env_logger format
|
RA_LOG Set log filter in env_logger format
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ fn main() {
|
|||||||
|
|
||||||
fn try_main() -> Result<()> {
|
fn try_main() -> Result<()> {
|
||||||
let args = args::Args::parse()?;
|
let args = args::Args::parse()?;
|
||||||
|
|
||||||
|
#[cfg(debug_assertions)]
|
||||||
if args.wait_dbg || env::var("RA_WAIT_DBG").is_ok() {
|
if args.wait_dbg || env::var("RA_WAIT_DBG").is_ok() {
|
||||||
#[allow(unused_mut)]
|
#[allow(unused_mut)]
|
||||||
let mut d = 4;
|
let mut d = 4;
|
||||||
|
|||||||
Reference in New Issue
Block a user