From af6810f0cc4559470409f476252efa13c424ab82 Mon Sep 17 00:00:00 2001 From: pommicket Date: Thu, 25 Sep 2025 21:51:14 -0400 Subject: Start animalia --- src/animalia.rs | 9 +++++++++ src/definitions.rs | 2 +- src/main.rs | 4 +++- 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 src/animalia.rs diff --git a/src/animalia.rs b/src/animalia.rs new file mode 100644 index 0000000..f3b3261 --- /dev/null +++ b/src/animalia.rs @@ -0,0 +1,9 @@ +use std::error::Error; + +pub fn main(args: Vec) -> Result<(), Box> { + if !args.is_empty() { + Err("No arguments expected to 'animalia' command")?; + } + + Ok(()) +} diff --git a/src/definitions.rs b/src/definitions.rs index d3d0192..b28c52e 100644 --- a/src/definitions.rs +++ b/src/definitions.rs @@ -364,7 +364,7 @@ fn parse_xml( Ok(()) } -pub fn definitions(args: Vec) -> Result<(), Box> { +pub fn main(args: Vec) -> Result<(), Box> { let mut files: Vec = vec![]; for arg in args { if arg == "-h" || arg == "--help" { diff --git a/src/main.rs b/src/main.rs index f484ade..0fcc3d6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,6 +4,7 @@ use std::io::BufWriter; use std::process::ExitCode; mod definitions; +mod animalia; fn do_write(path: &str, write_func: W) -> Result<(), Box> where @@ -43,7 +44,8 @@ fn try_main() -> Result<(), Box> { command_args.push(arg.to_owned()); } match &command.to_string_lossy()[..] { - "definitions" => definitions::definitions(command_args), + "definitions" => definitions::main(command_args), + "animalia" => animalia::main(command_args), x => Err(format!("Unrecognized command: {x}").into()), } } -- cgit v1.2.3