mirror of
https://codeberg.org/demostf/edit.git
synced 2026-10-01 07:34:05 +02:00
fix cli build
This commit is contained in:
parent
492ac6572c
commit
651f59cbea
4 changed files with 33 additions and 8 deletions
|
|
@ -19,19 +19,17 @@ struct Args {
|
|||
|
||||
impl Args {
|
||||
fn get_options(&self) -> EditOptions {
|
||||
EditOptions {
|
||||
unlock_pov: self.unlock_pov,
|
||||
cut: if let (Some(from), Some(to)) = (self.from, self.to) {
|
||||
EditOptions::builder()
|
||||
.unlock_pov(self.unlock_pov)
|
||||
.remove_invalid_deletes(self.remove_invalid_deletes)
|
||||
.cut(if let (Some(from), Some(to)) = (self.from, self.to) {
|
||||
Some(TickRange {
|
||||
from: from.into(),
|
||||
to: to.into(),
|
||||
})
|
||||
} else {
|
||||
None
|
||||
},
|
||||
remove_invalid_deletes: self.remove_invalid_deletes,
|
||||
..EditOptions::default()
|
||||
}
|
||||
}).build()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,13 +7,18 @@ use tf_demo_parser::demo::message::Message;
|
|||
|
||||
#[derive(Debug, Serialize, Deserialize, Default)]
|
||||
#[non_exhaustive]
|
||||
#[cfg_attr(feature = "cli", derive(typed_builder::TypedBuilder))]
|
||||
pub struct EditOptions {
|
||||
#[cfg_attr(feature = "cli", builder(default))]
|
||||
pub unlock_pov: bool,
|
||||
#[serde(default)]
|
||||
#[cfg_attr(feature = "cli", builder(default))]
|
||||
pub remove_conditions: Vec<CondOptions>,
|
||||
#[serde(default)]
|
||||
#[cfg_attr(feature = "cli", builder(default))]
|
||||
pub cut: Option<TickRange>,
|
||||
#[serde(default)]
|
||||
#[cfg_attr(feature = "cli", builder(default))]
|
||||
pub remove_invalid_deletes: bool,
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue