Executes the `convert` subcommand
(cmd_args: &ConvertSubcommandArgs)
| 56 | |
| 57 | /// Executes the `convert` subcommand |
| 58 | pub 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 | |
| 75 | fn convert_particles(cmd_args: &ConvertSubcommandArgs) -> Result<(), anyhow::Error> { |
| 76 | profile!("particle file conversion cli"); |
no test coverage detected