Skip to content

Commit

Permalink
update so that listing rules works
Browse files Browse the repository at this point in the history
  • Loading branch information
camc314 committed Sep 29, 2023
1 parent a59ed67 commit 6306f50
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,3 @@ crates/oxc_napi/*.node
/*.jsx
/*.ts
/*.tsx

# MacOS
.DS_Store
2 changes: 1 addition & 1 deletion crates/oxc_cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<PathBuf>,
}

Expand Down
5 changes: 5 additions & 0 deletions crates/oxc_cli/src/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use std::{
#[derive(Debug)]
pub enum CliRunResult {
None,
InvalidOptions { message: String },
PathNotFound { paths: Vec<PathBuf> },
LintResult(LintResult),
TypeCheckResult { duration: Duration, number_of_diagnostics: usize },
Expand All @@ -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)
Expand Down

0 comments on commit 6306f50

Please sign in to comment.