Skip to content

Commit 9bcd867

Browse files
committed
Make change backwards compatible
1 parent 598e370 commit 9bcd867

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/main.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use anyhow::Result;
2-
use clap::{Parser, ValueEnum};
2+
use clap::{builder::BoolishValueParser, Parser, ValueEnum};
33
use clap_verbosity_flag::InfoLevel;
44
use log::LevelFilter;
55
use regex::Regex;
@@ -41,7 +41,8 @@ struct Args {
4141
#[arg(short, long)]
4242
after_build: Option<String>,
4343

44-
#[arg(short, long, default_value = "false")]
44+
// Disable timing on the output
45+
#[arg(short, long, default_value = "false", num_args = 0..=1)]
4546
no_timing: bool,
4647

4748
/// Verbosity:
@@ -56,7 +57,7 @@ struct Args {
5657

5758
/// This creates a source_dirs.json file at the root of the monorepo, which is needed when you
5859
/// want to use Reanalyze
59-
#[arg(short, long, default_value = "false")]
60+
#[arg(short, long, default_value_t = false, num_args = 0..=1)]
6061
create_sourcedirs: bool,
6162

6263
/// This prints the compiler arguments. It expects the path to a rescript.json file.
@@ -68,7 +69,7 @@ struct Args {
6869
/// It's important to know that we currently do not discern between project src, and
6970
/// dependencies. So enabling this flag will enable building _all_ development dependencies of
7071
/// _all_ packages
71-
#[arg(long, default_value = "false")]
72+
#[arg(long, default_value_t = false, num_args = 0..=1)]
7273
dev: bool,
7374

7475
/// To be used in conjunction with compiler_args

0 commit comments

Comments
 (0)