Skip to content

Commit

Permalink
Add --keep flag to crf-search subcommand
Browse files Browse the repository at this point in the history
  • Loading branch information
t-nil committed Jan 1, 2024
1 parent 2ad10ee commit b1e51e7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/command/crf_search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ pub struct Args {
#[arg(long)]
pub crf_increment: Option<f32>,

// TODO refactor into Samples ArgGroup
/// Keep temporary files after exiting.
#[arg(long)]
pub keep: bool,

/// Enable sample-encode caching.
#[arg(
long,
Expand Down Expand Up @@ -125,6 +130,7 @@ pub async fn run(
thorough,
sample,
quiet,
keep,
cache,
vmaf,
}: &Args,
Expand All @@ -146,7 +152,7 @@ pub async fn run(
args: args.clone(),
crf: 0.0,
sample: sample.clone(),
keep: false,
keep: *keep,
cache: *cache,
stdout_format: sample_encode::StdoutFormat::Json,
vmaf: vmaf.clone(),
Expand Down
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ impl Command {
fn keep_temp_files(&self) -> bool {
match self {
Self::SampleEncode(args) => args.keep,
Self::CrfSearch(args) => args.keep,
_ => false,
}
}
Expand Down

0 comments on commit b1e51e7

Please sign in to comment.