shell_is_all_you_need/
lib.rs1mod cli;
5mod config;
6mod json;
7mod limits;
8mod path_policy;
9mod process;
10mod protocol;
11mod schema;
12mod server;
13mod sys;
14mod task;
15mod template;
16mod tool;
17
18#[cfg(test)]
19mod test_support;
20
21use std::process::ExitCode;
22
23pub fn main(args: impl IntoIterator<Item = String>) -> ExitCode {
28 let command = match cli::parse(args) {
29 Ok(command) => command,
30 Err(error) => {
31 eprintln!("shell-is-all-you-need: {error}");
32 return ExitCode::from(2);
33 }
34 };
35 match command {
36 cli::Command::Help => println!("{}", cli::USAGE),
37 cli::Command::Version => println!("shell-is-all-you-need {}", env!("CARGO_PKG_VERSION")),
38 cli::Command::Serve(config) => {
39 if let Err(error) = server::serve(config) {
40 eprintln!("shell-is-all-you-need: {error}");
41 return ExitCode::FAILURE;
42 }
43 }
44 }
45 ExitCode::SUCCESS
46}