Skip to content
Merged
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
8 changes: 0 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ maud = "0.27"
anyhow = "1.0"
thiserror = "2.0"
walkdir = "2.4"
lazy_static = "1.4"
rayon = "1.8"
log = "0.4"
env_logger = "0.11"
Expand All @@ -37,7 +36,6 @@ globset = "0.4.16"
rustc-hash = "2.1"
difference = "2.0"
reqvire = { path = "core" }
once_cell = "1.19"
tiny_http = "0.12"


Expand Down
66 changes: 33 additions & 33 deletions cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use std::path::Path;
#[clap(
author,
version,
about = "Reqvire requirements & treacibility management tool",
about = "Reqvire requirements & traceability management tool",
long_about = None,
name = "reqvire"
)]
Expand Down Expand Up @@ -149,8 +149,8 @@ pub enum Commands {
filter_attachment: Option<String>,
},

/// Analise change impact and provides report
#[clap(override_help = "Analise change impact and provides report\n\nCHANGE IMPACT OPTIONS:\n --git-commit <GIT_COMMIT> Git commit hash to use when comparing models [default: HEAD]\n --json Output results in JSON format\n --output <FILE> Save JSON output to file (requires --json)")]
/// Analyze change impact and provide report
#[clap(override_help = "Analyze change impact and provide report\n\nCHANGE IMPACT OPTIONS:\n --git-commit <GIT_COMMIT> Git commit hash to use when comparing models [default: HEAD]\n --json Output results in JSON format\n --output <FILE> Save JSON output to file (requires --json)")]
ChangeImpact {
/// Git commit hash to use when comparing models
#[clap(long, default_value = "HEAD", help_heading = "CHANGE IMPACT OPTIONS")]
Expand Down Expand Up @@ -581,7 +581,7 @@ fn print_custom_help(cmd: &clap::Command) {
let short = arg.get_short().map(|s| format!("-{}, ", s)).unwrap_or_default();
let value_name = if arg.get_action().takes_values() {
let value = arg.get_value_names()
.and_then(|v| v.get(0))
.and_then(|v| v.first())
.map(|s| s.to_string())
.unwrap_or_else(|| "VALUE".to_string());
format!(" <{}>", value)
Expand Down Expand Up @@ -617,7 +617,7 @@ fn print_custom_help(cmd: &clap::Command) {
let long = arg.get_long().map(|l| format!("--{}", l)).unwrap_or_default();
let value_name = if arg.get_action().takes_values() {
let value = arg.get_value_names()
.and_then(|v| v.get(0))
.and_then(|v| v.first())
.map(|s| s.to_string())
.unwrap_or_else(|| "VALUE".to_string());
format!(" <{}>", value)
Expand Down Expand Up @@ -651,7 +651,7 @@ fn print_custom_help(cmd: &clap::Command) {
let long = arg.get_long().map(|l| format!("--{}", l)).unwrap_or_default();
let value_name = if arg.get_action().takes_values() {
let value = arg.get_value_names()
.and_then(|v| v.get(0))
.and_then(|v| v.first())
.map(|s| s.to_string())
.unwrap_or_else(|| "VALUE".to_string());
format!(" <{}>", value)
Expand Down Expand Up @@ -694,10 +694,10 @@ fn print_validation_results(errors: &[ReqvireError], json_output: bool) {
println!("{}", serde_json::to_string_pretty(&json_result).unwrap());
} else {
println!("\n❌ {} validation failed with error(s):", errors.len());
println!("");
println!();
for (i, error) in errors.iter().enumerate() {
println!(" {}. {}", i + 1, error);
println!("");
println!();
}
println!();
}
Expand Down Expand Up @@ -826,7 +826,7 @@ pub fn handle_command(
} else {
println!("✅ No validation issues found");
}
return Ok(0);
Ok(0)
},
Some(Commands::Search {
json,
Expand Down Expand Up @@ -869,7 +869,7 @@ pub fn handle_command(
} else {
println!("{}", report_output);
}
return Ok(0);
Ok(0)
},
Some(Commands::ChangeImpact { json, git_commit, output }) => {
validate_output_requires_json(&output, json)?;
Expand Down Expand Up @@ -898,7 +898,7 @@ pub fn handle_command(
println!("{}", report.to_text(&base_url, &current_commit, &git_commit));
}

return Ok(0);
Ok(0)
},
Some(Commands::Format { fix, json, output, with_full_relations }) => {
validate_output_requires_json(&output, json)?;
Expand All @@ -912,7 +912,7 @@ pub fn handle_command(
} else {
render_diff(&format_result);
}
return Ok(0);
Ok(0)
},
Some(Commands::Traces {
json,
Expand Down Expand Up @@ -953,7 +953,7 @@ pub fn handle_command(
println!("{}", markdown_output);
}

return Ok(0);
Ok(0)
},
Some(Commands::Coverage { json, output }) => {
validate_output_requires_json(&output, json)?;
Expand All @@ -963,7 +963,7 @@ pub fn handle_command(
} else {
coverage_report.print(false);
}
return Ok(0);
Ok(0)
},
Some(Commands::Model { from, reverse, filter_type, json, output }) => {
validate_output_requires_json(&output, json)?;
Expand All @@ -986,7 +986,7 @@ pub fn handle_command(
} else {
println!("{}", report_output);
}
return Ok(0);
Ok(0)
},
Some(Commands::Lint { fixable, auditable, fix, json, output }) => {
validate_output_requires_json(&output, json)?;
Expand Down Expand Up @@ -1039,7 +1039,7 @@ pub fn handle_command(
}
}

return Ok(0);
Ok(0)
},
Some(Commands::Export { output }) => {
let git_root = git_commands::get_git_root_dir()?;
Expand Down Expand Up @@ -1073,7 +1073,7 @@ pub fn handle_command(
)?;
println!("✅ Export completed successfully to: {}", temp_dir.display());
}
return Ok(0);
Ok(0)
},
Some(Commands::Serve { host, port }) => {
// Enable quiet mode for serve command (suppress verbose export output)
Expand All @@ -1095,7 +1095,7 @@ pub fn handle_command(
// Cleanup temporary directory after server stops
std::fs::remove_dir_all(&temp_dir)?;

return Ok(0);
Ok(0)
},
Some(Commands::Add { file, content, override_existing, dry_run, json, output }) => {
validate_output_requires_json(&output, json)?;
Expand Down Expand Up @@ -1135,7 +1135,7 @@ pub fn handle_command(
render_crud_result(&result);
}

return Ok(0);
Ok(0)
},
Some(Commands::Rm { element_name, dry_run, json, output }) => {
validate_output_requires_json(&output, json)?;
Expand All @@ -1158,7 +1158,7 @@ pub fn handle_command(
render_crud_result(&result);
}

return Ok(0);
Ok(0)
},
Some(Commands::Mv { element_name, file, dry_run, json, output }) => {
validate_output_requires_json(&output, json)?;
Expand All @@ -1184,7 +1184,7 @@ pub fn handle_command(
render_crud_result(&result);
}

return Ok(0);
Ok(0)
},
Some(Commands::Rename { element_name, new_name, dry_run, json, output }) => {
validate_output_requires_json(&output, json)?;
Expand All @@ -1208,7 +1208,7 @@ pub fn handle_command(
render_crud_result(&result);
}

return Ok(0);
Ok(0)
},
Some(Commands::Merge { target, sources, dry_run, json, output }) => {
validate_output_requires_json(&output, json)?;
Expand All @@ -1229,7 +1229,7 @@ pub fn handle_command(
render_crud_result(&result);
}

return Ok(0);
Ok(0)
},
Some(Commands::MvFile { source_file, target_file, squash, dry_run, json, output }) => {
validate_output_requires_json(&output, json)?;
Expand All @@ -1252,7 +1252,7 @@ pub fn handle_command(
render_crud_result(&result);
}

return Ok(0);
Ok(0)
},
Some(Commands::Link { source, relation_type, target, dry_run }) => {
let git_root = git_commands::get_git_root_dir()?;
Expand Down Expand Up @@ -1305,7 +1305,7 @@ pub fn handle_command(
)?;
render_crud_result(&result);
}
return Ok(0);
Ok(0)
},
Some(Commands::Unlink { source, target, dry_run }) => {
let git_root = git_commands::get_git_root_dir()?;
Expand All @@ -1317,7 +1317,7 @@ pub fn handle_command(
dry_run,
)?;
render_crud_result(&result);
return Ok(0);
Ok(0)
},
Some(Commands::MvAsset { old_path, new_path, dry_run }) => {
let git_root = git_commands::get_git_root_dir()?;
Expand All @@ -1330,7 +1330,7 @@ pub fn handle_command(
)?;

render_crud_result(&result);
return Ok(0);
Ok(0)
},
Some(Commands::RmAsset { file_path, dry_run }) => {
let git_root = git_commands::get_git_root_dir()?;
Expand All @@ -1342,7 +1342,7 @@ pub fn handle_command(
)?;

render_crud_result(&result);
return Ok(0);
Ok(0)
},
Some(Commands::Containment { json, output, short }) => {
validate_output_requires_json(&output, json)?;
Expand All @@ -1357,7 +1357,7 @@ pub fn handle_command(
let diagram_output = diagrams::generate_containment_diagram(&model_manager.graph_registry, short)?;
println!("{}", diagram_output);
}
return Ok(0);
Ok(0)
},
Some(Commands::Resources { json, output }) => {
validate_output_requires_json(&output, json)?;
Expand All @@ -1367,7 +1367,7 @@ pub fn handle_command(
let report = report_resources::generate_resources_report(&model_manager.graph_registry);
report.print(false);
}
return Ok(0);
Ok(0)
},
Some(Commands::Collect { element_name, direction, json, output }) => {
validate_output_requires_json(&output, json)?;
Expand All @@ -1392,15 +1392,15 @@ pub fn handle_command(
} else {
println!("{}", report_output);
}
return Ok(0);
Ok(0)
},
Some(Commands::Shell) => {
run_shell(&mut model_manager)?;
return Ok(0);
Ok(0)
},
Some(Commands::Sout) => {
run_sout(&model_manager.graph_registry)?;
return Ok(0);
Ok(0)
},
None => {
// This case is handled at the beginning of handle_command
Expand Down
3 changes: 0 additions & 3 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ documentation.workspace = true
# Parsing and content manipulation
pulldown-cmark = { workspace = true }
regex = { workspace = true }
lazy_static = { workspace = true }
difference = { workspace = true }

# Path handling
Expand Down Expand Up @@ -40,8 +39,6 @@ rustc-hash = { workspace = true }
# Terminal output
termcolor = { workspace = true }

once_cell = { workspace = true }

[dev-dependencies]
assert_fs = { workspace = true }
predicates = { workspace = true }
Expand Down
Loading
Loading