aKode fase 5: rinomina interna (crate akode-*, akode-rs/, akode-cli/, binario akode, AKODE_*, ~/.akode, snapshot)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
22
akode-rs/windows-sandbox-service/src/main.rs
Normal file
22
akode-rs/windows-sandbox-service/src/main.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
use anyhow::Result;
|
||||
use akode_windows_sandbox_service::RunMode;
|
||||
|
||||
fn main() -> Result<()> {
|
||||
akode_windows_sandbox_service::run(parse_mode(std::env::args().skip(1))?)
|
||||
}
|
||||
|
||||
fn parse_mode(arguments: impl Iterator<Item = String>) -> Result<RunMode> {
|
||||
let arguments = arguments.collect::<Vec<_>>();
|
||||
match arguments.as_slice() {
|
||||
[] => Ok(RunMode::Service),
|
||||
[argument] if argument == "--service" => Ok(RunMode::Service),
|
||||
#[cfg(debug_assertions)]
|
||||
[argument] if argument == "--foreground" => Ok(RunMode::Foreground),
|
||||
[argument] => anyhow::bail!("unrecognized service argument {argument:?}"),
|
||||
_ => anyhow::bail!("expected at most one service argument"),
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "main_tests.rs"]
|
||||
mod tests;
|
||||
Reference in New Issue
Block a user