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
Original file line number Diff line number Diff line change
@@ -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.
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"]
Expand Down
14 changes: 14 additions & 0 deletions src/about.rs
Original file line number Diff line number Diff line change
@@ -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!();
}
2 changes: 2 additions & 0 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pub mod about;
pub mod analysis;
pub mod cli;
pub mod error;
Expand Down
4 changes: 4 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
Loading