From e803aa488c3a95193d3e3ae358b640c299f8f121 Mon Sep 17 00:00:00 2001 From: salmonik Date: Mon, 23 Nov 2026 20:36:22 +0100 Subject: License --- src/doctor.rs | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'src/doctor.rs') diff --git a/src/doctor.rs b/src/doctor.rs index 8baf1f7..e7b949e 100644 --- a/src/doctor.rs +++ b/src/doctor.rs @@ -1,3 +1,10 @@ +/* + * This file is part of agent686 + * Copyright (C) 2026 Salmonik + * SPDX-License-Identifier: GPL-3.0-or-later + * https://git.2137697.xyz/agent686 + */ + use std::path::Path; use serde_json::json; @@ -32,7 +39,8 @@ pub fn run(cfg: &Config, json: bool) -> i32 { } record("key", true, detail); } - KeySource::Missing => record("key", + KeySource::Missing => record( + "key", false, "missing — set OPENCODE_API_KEY or write ~/.config/agent686/key".into(), ), @@ -55,11 +63,7 @@ pub fn run(cfg: &Config, json: bool) -> i32 { true, format!("{} ({} entries)", history.display(), text.lines().count()), ), - Err(_) => record( - "history", - true, - format!("{} (new)", history.display()), - ), + Err(_) => record("history", true, format!("{} (new)", history.display())), } record("provider", true, cfg.base_url.clone()); @@ -70,7 +74,11 @@ pub fn run(cfg: &Config, json: bool) -> i32 { } else { match provider::models(cfg) { Ok(models) => { - record("auth", true, format!("ok — {} models visible", models.len())); + record( + "auth", + true, + format!("ok — {} models visible", models.len()), + ); if models.iter().any(|id| id == &cfg.model) { record("model known", true, "yes".into()); } else { @@ -107,7 +115,11 @@ pub fn run(cfg: &Config, json: bool) -> i32 { ); println!(); for (label, ok, detail) in &checks { - println!("{:<13} {:<4} {detail}", label, if *ok { "ok" } else { "FAIL" }); + println!( + "{:<13} {:<4} {detail}", + label, + if *ok { "ok" } else { "FAIL" } + ); } println!(); if failed { -- cgit v1.2.3