Skip to content

Commit 552ae86

Browse files
committed
Allow setting --debug-model flag to false
1 parent d85a3d4 commit 552ae86

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/cli.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ pub struct RunOpts {
3636
#[arg(long)]
3737
pub overwrite: bool,
3838
/// Whether to write additional information to CSV files
39-
#[arg(long)]
40-
pub debug_model: bool,
39+
#[arg(long, value_name = "BOOL", num_args = 0..=1, default_missing_value = "true")]
40+
pub debug_model: Option<bool>,
4141
}
4242

4343
/// The available commands.
@@ -116,8 +116,8 @@ pub fn handle_run_command(
116116
};
117117

118118
// These settings can be overridden by command-line arguments
119-
if opts.debug_model {
120-
settings.debug_model = true;
119+
if let Some(opt) = opts.debug_model {
120+
settings.debug_model = opt;
121121
}
122122
if opts.overwrite {
123123
settings.overwrite = true;

tests/regression.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ fn run_regression_test_debug_opt(example_name: &str, debug_model: bool) {
4343
let opts = RunOpts {
4444
output_dir: Some(output_dir.clone()),
4545
overwrite: false,
46-
debug_model: true, // NB: Always enable this as it helps to have the files for debugging
46+
debug_model: Some(true), // NB: Always enable this as it helps to have the files for debugging
4747
};
4848
handle_example_run_command(example_name, &opts, Some(Settings::default())).unwrap();
4949

tests/run.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fn test_handle_run_command() {
2525
let opts = RunOpts {
2626
output_dir: Some(output_dir),
2727
overwrite: false,
28-
debug_model: false,
28+
debug_model: None,
2929
};
3030
handle_run_command(&get_model_dir(), &opts, Some(Settings::default())).unwrap();
3131

0 commit comments

Comments
 (0)