From 01dd8e5ef9a90af5f5daffc8dea1ad8ce8893fea Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Mon, 9 Mar 2026 01:25:42 -0400 Subject: [PATCH] search: add --full flag to show node content in results Co-Authored-By: ProofOfConcept --- poc-memory/src/main.rs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/poc-memory/src/main.rs b/poc-memory/src/main.rs index 673c4ce..57b8520 100644 --- a/poc-memory/src/main.rs +++ b/poc-memory/src/main.rs @@ -71,6 +71,9 @@ enum Command { /// Show more results #[arg(long)] expand: bool, + /// Show node content, not just keys + #[arg(long)] + full: bool, /// Show debug output for each pipeline stage #[arg(long)] debug: bool, @@ -478,8 +481,8 @@ fn main() { let cli = Cli::parse(); let result = match cli.command { - Command::Search { query, pipeline, expand, debug } - => cmd_search(&query, &pipeline, expand, debug), + Command::Search { query, pipeline, expand, full, debug } + => cmd_search(&query, &pipeline, expand, full, debug), Command::Init => cmd_init(), Command::Migrate => cmd_migrate(), Command::Health => cmd_health(), @@ -584,7 +587,7 @@ fn main() { // ── Command implementations ───────────────────────────────────────── -fn cmd_search(terms: &[String], pipeline_args: &[String], expand: bool, debug: bool) -> Result<(), String> { +fn cmd_search(terms: &[String], pipeline_args: &[String], expand: bool, full: bool, debug: bool) -> Result<(), String> { use store::StoreView; use std::collections::BTreeMap; @@ -656,6 +659,15 @@ fn cmd_search(terms: &[String], pipeline_args: &[String], expand: bool, debug: b let marker = if r.is_direct { "→" } else { " " }; let weight = view.node_weight(&r.key); println!("{}{:2}. [{:.2}/{:.2}] {}", marker, i + 1, r.activation, weight, r.key); + if full { + if let Some(content) = view.node_content(&r.key) { + println!(); + for line in content.lines() { + println!(" {}", line); + } + println!(); + } + } } Ok(())