summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2025-09-25 21:51:14 -0400
committerpommicket <pommicket@gmail.com>2025-09-25 21:51:14 -0400
commitaf6810f0cc4559470409f476252efa13c424ab82 (patch)
treedd7b457b9f6cf63e10c7edd826c3494352afc1f5
parentbb784f99cfcf17fd01bfd64e5add57bdd0d88673 (diff)
Start animalia
-rw-r--r--src/animalia.rs9
-rw-r--r--src/definitions.rs2
-rw-r--r--src/main.rs4
3 files changed, 13 insertions, 2 deletions
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<String>) -> Result<(), Box<dyn Error>> {
+ 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<String>) -> Result<(), Box<dyn Error>> {
+pub fn main(args: Vec<String>) -> Result<(), Box<dyn Error>> {
let mut files: Vec<String> = 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<W, E: Error>(path: &str, write_func: W) -> Result<(), Box<dyn Error>>
where
@@ -43,7 +44,8 @@ fn try_main() -> Result<(), Box<dyn Error>> {
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()),
}
}