MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/splashsurf / convert_subcommand

Function convert_subcommand

splashsurf/src/convert.rs:58–73  ·  view source on GitHub ↗

Executes the `convert` subcommand

(cmd_args: &ConvertSubcommandArgs)

Source from the content-addressed store, hash-verified

56
57/// Executes the `convert` subcommand
58pub fn convert_subcommand(cmd_args: &ConvertSubcommandArgs) -> Result<(), anyhow::Error> {
59 // Check if file already exists
60 overwrite_check(cmd_args)?;
61
62 match (&cmd_args.input_particles, &cmd_args.input_mesh) {
63 (Some(_), _) => convert_particles(cmd_args)?,
64 (_, Some(_)) => convert_mesh(cmd_args)?,
65 (_, _) => {
66 return Err(anyhow!(
67 "Aborting: No input file specified, either a particle or mesh input file has to be specified."
68 ));
69 }
70 }
71
72 Ok(())
73}
74
75fn convert_particles(cmd_args: &ConvertSubcommandArgs) -> Result<(), anyhow::Error> {
76 profile!("particle file conversion cli");

Callers 1

run_splashsurf_implFunction · 0.85

Calls 3

overwrite_checkFunction · 0.85
convert_particlesFunction · 0.85
convert_meshFunction · 0.85

Tested by

no test coverage detected