memoryd (files, the check, edits, journal, index, recall, serving), the memory tools and built-in grants in brokerd, the memory block in loopd, bxctl reindex and memory, and the device checks with memoryd. Each task was built as a reference and gated. Each was replayed on its own at its end state (854 to 936 tests) and mutation-checked. Each skeleton compiles and fails its tests. Every todo comment was read beside its signature. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
34 lines
965 B
Rust
34 lines
965 B
Rust
//! `memoryd serve --config <path>`.
|
|
|
|
use std::ffi::OsString;
|
|
use std::path::PathBuf;
|
|
use std::process::ExitCode;
|
|
|
|
const USAGE: &str = "usage: memoryd serve --config <path>";
|
|
|
|
fn main() -> ExitCode {
|
|
let args: Vec<OsString> = std::env::args_os().skip(1).collect();
|
|
let Some(config) = parse(&args) else {
|
|
eprintln!("{USAGE}");
|
|
return ExitCode::from(2);
|
|
};
|
|
match memoryd::config::Config::load(&config) {
|
|
Ok(_) => {
|
|
eprintln!("memoryd: not implemented");
|
|
ExitCode::from(2)
|
|
}
|
|
Err(e) => {
|
|
eprintln!("memoryd: {e}\nsee docs/runbook.md#memoryd-start-failed");
|
|
ExitCode::from(1)
|
|
}
|
|
}
|
|
}
|
|
|
|
/// The config path of `serve --config <path>`, or `None` for any other list.
|
|
fn parse(args: &[OsString]) -> Option<PathBuf> {
|
|
match args {
|
|
[serve, flag, path] if serve == "serve" && flag == "--config" => Some(PathBuf::from(path)),
|
|
_ => None,
|
|
}
|
|
}
|