Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,17 @@ pub enum Commands {
json: bool,

/// Show detailed analysis information (legacy format)
#[arg(short, long, conflicts_with = "display")]
#[arg(short, long, conflicts_with_all = ["display", "summary", "matrix"])]
detailed: bool,

/// Show summary analysis information
#[arg(short, long, conflicts_with_all = ["display", "detailed", "matrix"])]
summary: bool,

/// Show matrix/dashboard analysis information
#[arg(short = 'M', long, conflicts_with_all = ["display", "detailed", "summary"])]
matrix: bool,

/// Display format for analysis results
#[arg(long, value_enum, default_value = "matrix")]
display: Option<DisplayFormat>,
Expand Down
8 changes: 7 additions & 1 deletion src/handlers/analyze.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ pub fn handle_analyze(
path: std::path::PathBuf,
json: bool,
detailed: bool,
summary: bool,
matrix: bool,
display: Option<DisplayFormat>,
_only: Option<Vec<String>>,
color_scheme: Option<ColorScheme>,
Expand Down Expand Up @@ -39,10 +41,14 @@ pub fn handle_analyze(
let output = if json {
display_analysis_with_return(&monorepo_analysis, DisplayMode::Json)
} else {
// Determine display mode
// Determine display mode from flags (standalone flags take precedence over --display)
let mode = if detailed {
// Legacy flag for backward compatibility
DisplayMode::Detailed
} else if summary {
DisplayMode::Summary
} else if matrix {
DisplayMode::Matrix
} else {
match display {
Some(DisplayFormat::Matrix) | None => DisplayMode::Matrix,
Expand Down
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ pub async fn run_command(
path,
json,
detailed,
summary,
matrix,
display,
only,
color_scheme,
} => {
match handlers::handle_analyze(path, json, detailed, display, only, color_scheme) {
match handlers::handle_analyze(path, json, detailed, summary, matrix, display, only, color_scheme) {
Ok(_output) => Ok(()), // The output was already printed by display_analysis_with_return
Err(e) => Err(e),
}
Expand Down
12 changes: 11 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ async fn run() -> syncable_cli::Result<()> {
path,
json,
detailed,
summary,
matrix,
display,
only,
color_scheme,
Expand All @@ -139,6 +141,10 @@ async fn run() -> syncable_cli::Result<()> {
"json"
} else if detailed {
"detailed"
} else if summary {
"summary"
} else if matrix {
"matrix"
} else {
match display {
Some(DisplayFormat::Matrix) | None => "matrix",
Expand Down Expand Up @@ -169,7 +175,7 @@ async fn run() -> syncable_cli::Result<()> {
telemetry_client.track_analyze_folder(properties);
}

match handle_analyze(path, json, detailed, display, only, color_scheme) {
match handle_analyze(path, json, detailed, summary, matrix, display, only, color_scheme) {
Ok(_output) => Ok(()), // The output was already printed by display_analysis_with_return
Err(e) => Err(e),
}
Expand Down Expand Up @@ -1548,6 +1554,8 @@ pub fn handle_analyze(
path: std::path::PathBuf,
json: bool,
detailed: bool,
summary: bool,
matrix: bool,
display: Option<DisplayFormat>,
only: Option<Vec<String>>,
color_scheme: Option<ColorScheme>,
Expand All @@ -1557,6 +1565,8 @@ pub fn handle_analyze(
path,
json,
detailed,
summary,
matrix,
display,
only,
color_scheme,
Expand Down