From 3013e5186106a1eada5dfafce787d78bb9e63934 Mon Sep 17 00:00:00 2001 From: hu13-test Date: Tue, 27 Oct 2026 19:51:40 +0000 Subject: [PATCH] fix CLI exit and agents storage docs (#113, #114) --- src/agents.rs | 2 +- src/main.rs | 2 +- tests/build_cli.rs | 11 +++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/agents.rs b/src/agents.rs index 11a1a72..aecb428 100644 --- a/src/agents.rs +++ b/src/agents.rs @@ -61,7 +61,7 @@ fn agents_markdown( On success the server shows a `received` page with a one-time ack uuid (shown once, not in a URL, no lookup endpoint) and reflects nothing back (kills reflected XSS). No GET, no listing, no read-back. Inbox never appears in the site; accepted text shows up later as a real issue/PR.\n\n\ ### License (required — check the box only if you agree)\n\n\ > {license}\n\n\ - Stored per submission: license version + checkbox state + body hash + timestamp. No submission without the box checked.\n\n\ + Stored per submission: type, title, body, optional handle/contact, license version, `received_at`, and a salted source-IP hash. The checkbox is validated before storing; no submission is accepted without it.\n\n\ ## Philosophy\n\n\ - Issues = detailed actionable text from your user. Write what a maintainer can act on: context, steps, expected vs actual, links to `/raw/` paths.\n\ - PRs = ONE prompt not code. Send a single plain-text prompt describing the change; never send files, diffs, branches, or bundles. Code words inside stay text — never applied, never executed.\n\ diff --git a/src/main.rs b/src/main.rs index 9deb176..a9d0573 100644 --- a/src/main.rs +++ b/src/main.rs @@ -493,7 +493,7 @@ fn real_main() -> i32 { other => { eprintln!("hu13: unknown subcommand '{other}'"); print_top_help(); - 0 + 2 } } } diff --git a/tests/build_cli.rs b/tests/build_cli.rs index 5fdc205..494d529 100644 --- a/tests/build_cli.rs +++ b/tests/build_cli.rs @@ -17,6 +17,17 @@ fn git(repo: &Path, args: &[&str]) { assert!(st.success(), "git {args:?} failed"); } +#[test] +fn unknown_subcommand_exits_two() { + let out = Command::new(env!("CARGO_BIN_EXE_hu13")) + .arg("nope") + .output() + .expect("spawn hu13"); + assert_eq!(out.status.code(), Some(2), "unknown subcommand is an error"); + let stderr = String::from_utf8_lossy(&out.stderr); + assert!(stderr.contains("unknown subcommand 'nope'"), "{stderr}"); +} + #[test] fn build_no_forge_repo_exits_zero() { let dir = std::env::temp_dir().join(format!( -- 2.56.0