diff --git a/.gitignore b/.gitignore index 2fb49770b5823..611e7592de5b6 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,3 @@ crates/oxc_napi/*.node /*.jsx /*.ts /*.tsx - -# MacOS -.DS_Store \ No newline at end of file diff --git a/crates/oxc_cli/src/command.rs b/crates/oxc_cli/src/command.rs index 9e25180835370..bb3284c913ecc 100644 --- a/crates/oxc_cli/src/command.rs +++ b/crates/oxc_cli/src/command.rs @@ -85,7 +85,7 @@ pub struct LintOptions { pub misc_options: MiscOptions, /// Single file, single path or list of paths - #[bpaf(positional("PATH"), some("want at least one path"))] + #[bpaf(positional("PATH"), many)] pub paths: Vec, } diff --git a/crates/oxc_cli/src/result.rs b/crates/oxc_cli/src/result.rs index 355030c2fe751..6c97778d3a122 100644 --- a/crates/oxc_cli/src/result.rs +++ b/crates/oxc_cli/src/result.rs @@ -7,6 +7,7 @@ use std::{ #[derive(Debug)] pub enum CliRunResult { None, + InvalidOptions { message: String }, PathNotFound { paths: Vec }, LintResult(LintResult), TypeCheckResult { duration: Duration, number_of_diagnostics: usize }, @@ -26,6 +27,10 @@ impl Termination for CliRunResult { fn report(self) -> ExitCode { match self { Self::None => ExitCode::from(0), + Self::InvalidOptions { message } => { + println!("{}", message); + ExitCode::from(1) + } Self::PathNotFound { paths } => { println!("Path {paths:?} does not exist."); ExitCode::from(1)