Skip to content

Commit

Permalink
feat: improve print unknown parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
bc-m committed May 3, 2024
1 parent f65784a commit ac925e9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/script_steps/constants.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use strum_macros::FromRepr;
use strum_macros::{Display, FromRepr};

// Although it has no effect on this application, we track unused script IDs in this constant.
const UNKNOWN_SCRIPT_STEP: [u32; 16] = [
2, 3, 15, 52, 53, 54, 58, 100, 110, 162, 163, 170, 171, 173, 198, 204,
];

// https://help.claris.com/en/pro-help/content/script-steps-reference.html
#[derive(Debug, FromRepr, PartialEq)]
#[derive(Debug, FromRepr, PartialEq, Display)]
#[repr(u32)]
pub enum ScriptStep {
Unknown = 0,
Expand Down
7 changes: 6 additions & 1 deletion src/script_steps/parameters/parameter_values.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::script_steps::constants::id_to_script_step;
use quick_xml::events::{BytesStart, Event};
use quick_xml::Reader;

Expand Down Expand Up @@ -47,7 +48,11 @@ impl ParameterValues {
depth -= 1;
}
_ => {
eprintln!("Unknown parameter type: {}", parameter_type)
eprintln!(
"Unknown parameter \"{}\" in step \"{}\"",
parameter_type,
id_to_script_step(step_id)
)
}
}
}
Expand Down

0 comments on commit ac925e9

Please sign in to comment.