diff --git a/.devtrail/07-ai-audit/agent-logs/AILOG-2026-04-04-001-about-subcommand.md b/.devtrail/07-ai-audit/agent-logs/AILOG-2026-04-04-001-about-subcommand.md new file mode 100644 index 0000000..fc1423f --- /dev/null +++ b/.devtrail/07-ai-audit/agent-logs/AILOG-2026-04-04-001-about-subcommand.md @@ -0,0 +1,44 @@ +--- +title: "Add `about` subcommand" +type: AILOG +date: 2026-04-04 +agent: claude-code-v1 +confidence: high +risk_level: low +review_required: false +tags: [cli, feature] +eu_ai_act_risk: not_applicable +nist_genai_risks: [] +iso_42001_clause: [] +files_changed: + - src/about.rs + - src/cli.rs + - src/main.rs + - src/lib.rs +--- + +## Summary + +Added `arborist about` subcommand that displays project metadata (version, description, author, license, repository, website). Follows the same format as `devtrail about`. + +## Changes + +- **src/about.rs** (new): Module with `print()` function that outputs project info using `env!()` macros to read `CARGO_PKG_VERSION` and `CARGO_PKG_DESCRIPTION` at compile time. +- **src/cli.rs**: Added `About` variant to the `Command` enum. +- **src/main.rs**: Added match arm for `Command::About` calling `about::print()`. +- **src/lib.rs**: Registered `pub mod about`. + +## Complexity Analysis + +Ran `arborist` on all changed files: + +| Function | Cognitive | Cyclomatic | SLOC | +|----------|-----------|------------|------| +| `about::print` | 0 | 1 | 13 | +| `main` | 3 | 6 | 17 | + +All functions remain at low complexity. No documentation escalation needed. + +## Rationale + +Provides a quick way for users to see project metadata without checking Cargo.toml or the repository directly. diff --git a/Cargo.toml b/Cargo.toml index 98c007c..0d14d0f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,11 +1,10 @@ [package] name = "arborist-cli" -version = "0.1.1" +version = "0.2.0" edition = "2024" description = "CLI for arborist-metrics: cognitive/cyclomatic complexity and SLOC metrics" license = "MIT OR Apache-2.0" repository = "https://github.com/StrangeDaysTech/arborist-cli" -homepage = "https://github.com/StrangeDaysTech/arborist-cli" readme = "README.md" keywords = ["complexity", "metrics", "cognitive", "cyclomatic", "cli"] categories = ["command-line-utilities", "development-tools"] diff --git a/src/about.rs b/src/about.rs new file mode 100644 index 0000000..4fe0f69 --- /dev/null +++ b/src/about.rs @@ -0,0 +1,14 @@ +pub fn print() { + let version = env!("CARGO_PKG_VERSION"); + let description = env!("CARGO_PKG_DESCRIPTION"); + + println!(); + println!(" Arborist CLI {version}"); + println!(" {description}"); + println!(); + println!(" Author: Strange Days Tech, S.A.S."); + println!(" License: MIT OR Apache-2.0"); + println!(" Repo: https://github.com/StrangeDaysTech/arborist-cli"); + println!(" Web: https://strangedays.tech"); + println!(); +} diff --git a/src/cli.rs b/src/cli.rs index 57e9b3e..c85b14e 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -33,6 +33,8 @@ pub struct Cli { #[derive(Debug, Subcommand)] pub enum Command { + /// Display project information + About, /// Check for updates and install the latest version Update { /// Only check for available updates without installing diff --git a/src/lib.rs b/src/lib.rs index 26e945e..b7f9f31 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,4 @@ +pub mod about; pub mod analysis; pub mod cli; pub mod error; diff --git a/src/main.rs b/src/main.rs index 258bf44..532396a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,6 +8,10 @@ fn main() -> ExitCode { let cli = Cli::parse(); match cli.command { + Some(Command::About) => { + arborist_cli::about::print(); + ExitCode::SUCCESS + } Some(Command::Update { check }) => arborist_cli::update::run(check), None => match arborist_cli::run(&cli.analyze) { Ok(report) => report.exit_code(),