toolkit: shell
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
//! The programs that run inside tool containers.
|
||||
|
||||
use proto::tools::{ReadFileArgs, WriteFileArgs};
|
||||
use proto::tools::{ReadFileArgs, ShellArgs, WriteFileArgs};
|
||||
|
||||
pub mod files;
|
||||
pub mod input;
|
||||
pub mod shell;
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum Exit {
|
||||
@@ -77,6 +78,13 @@ pub fn run(name: &str, stdin: &mut dyn std::io::Read) -> Outcome {
|
||||
};
|
||||
files::write_file(&args)
|
||||
}
|
||||
"shell" => {
|
||||
let args = match input::parse::<ShellArgs>(name, &text) {
|
||||
Ok(a) => a,
|
||||
Err(e) => return Outcome::misuse(e),
|
||||
};
|
||||
shell::shell(&args)
|
||||
}
|
||||
_ => Outcome::misuse(format!("toolkit: unknown tool {name:?}")),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user