toolkit: the tool program, read_file and write_file

Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
This commit is contained in:
2026-09-23 00:00:03 -07:00
parent 644fda14da
commit 0d444dd5bf
10 changed files with 446 additions and 6 deletions
+14 -3
View File
@@ -1,4 +1,15 @@
fn main() {
eprintln!("toolkit: not implemented until M3");
std::process::exit(2);
use std::io::Write;
use std::process::ExitCode;
fn main() -> ExitCode {
let mut rest = std::env::args_os().skip(1);
let name = match (rest.next(), rest.next()) {
(Some(arg), None) => arg.to_str().unwrap_or("").to_string(),
_ => String::new(),
};
let outcome = toolkit::run(&name, &mut std::io::stdin().lock());
let _ = std::io::stdout().write_all(outcome.stdout.as_bytes());
let _ = std::io::stderr().write_all(outcome.stderr.as_bytes());
ExitCode::from(outcome.exit.code())
}