Skip to content

Commit 3019928

Browse files
montfortclaude
andauthored
feat: add about subcommand and bump to v0.2.0 (#13)
Add `arborist about` command displaying project metadata (version, description, author, license, repo, website). Remove `homepage` field from Cargo.toml — repository URL is sufficient for crates.io. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 25d4b83 commit 3019928

6 files changed

Lines changed: 66 additions & 2 deletions

File tree

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
title: "Add `about` subcommand"
3+
type: AILOG
4+
date: 2026-04-04
5+
agent: claude-code-v1
6+
confidence: high
7+
risk_level: low
8+
review_required: false
9+
tags: [cli, feature]
10+
eu_ai_act_risk: not_applicable
11+
nist_genai_risks: []
12+
iso_42001_clause: []
13+
files_changed:
14+
- src/about.rs
15+
- src/cli.rs
16+
- src/main.rs
17+
- src/lib.rs
18+
---
19+
20+
## Summary
21+
22+
Added `arborist about` subcommand that displays project metadata (version, description, author, license, repository, website). Follows the same format as `devtrail about`.
23+
24+
## Changes
25+
26+
- **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.
27+
- **src/cli.rs**: Added `About` variant to the `Command` enum.
28+
- **src/main.rs**: Added match arm for `Command::About` calling `about::print()`.
29+
- **src/lib.rs**: Registered `pub mod about`.
30+
31+
## Complexity Analysis
32+
33+
Ran `arborist` on all changed files:
34+
35+
| Function | Cognitive | Cyclomatic | SLOC |
36+
|----------|-----------|------------|------|
37+
| `about::print` | 0 | 1 | 13 |
38+
| `main` | 3 | 6 | 17 |
39+
40+
All functions remain at low complexity. No documentation escalation needed.
41+
42+
## Rationale
43+
44+
Provides a quick way for users to see project metadata without checking Cargo.toml or the repository directly.

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
[package]
22
name = "arborist-cli"
3-
version = "0.1.1"
3+
version = "0.2.0"
44
edition = "2024"
55
description = "CLI for arborist-metrics: cognitive/cyclomatic complexity and SLOC metrics"
66
license = "MIT OR Apache-2.0"
77
repository = "https://github.com/StrangeDaysTech/arborist-cli"
8-
homepage = "https://github.com/StrangeDaysTech/arborist-cli"
98
readme = "README.md"
109
keywords = ["complexity", "metrics", "cognitive", "cyclomatic", "cli"]
1110
categories = ["command-line-utilities", "development-tools"]

src/about.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
pub fn print() {
2+
let version = env!("CARGO_PKG_VERSION");
3+
let description = env!("CARGO_PKG_DESCRIPTION");
4+
5+
println!();
6+
println!(" Arborist CLI {version}");
7+
println!(" {description}");
8+
println!();
9+
println!(" Author: Strange Days Tech, S.A.S.");
10+
println!(" License: MIT OR Apache-2.0");
11+
println!(" Repo: https://github.com/StrangeDaysTech/arborist-cli");
12+
println!(" Web: https://strangedays.tech");
13+
println!();
14+
}

src/cli.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ pub struct Cli {
3333

3434
#[derive(Debug, Subcommand)]
3535
pub enum Command {
36+
/// Display project information
37+
About,
3638
/// Check for updates and install the latest version
3739
Update {
3840
/// Only check for available updates without installing

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
pub mod about;
12
pub mod analysis;
23
pub mod cli;
34
pub mod error;

src/main.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ fn main() -> ExitCode {
88
let cli = Cli::parse();
99

1010
match cli.command {
11+
Some(Command::About) => {
12+
arborist_cli::about::print();
13+
ExitCode::SUCCESS
14+
}
1115
Some(Command::Update { check }) => arborist_cli::update::run(check),
1216
None => match arborist_cli::run(&cli.analyze) {
1317
Ok(report) => report.exit_code(),

0 commit comments

Comments
 (0)