Build RecordOptions from command-line arguments.
(&self)
| 166 | |
| 167 | /// Build RecordOptions from command-line arguments. |
| 168 | pub(super) fn build_options(&self) -> CliResult<RecordOptions> { |
| 169 | let algorithm = self.parse_algorithm()?; |
| 170 | |
| 171 | let mut options = RecordOptions::new() |
| 172 | .with_all(self.all) |
| 173 | .with_algorithm(algorithm) |
| 174 | .with_skip_binary(self.skip_binary) |
| 175 | .apply_after_record(!self.dry_run) |
| 176 | .save_to_store(!self.dry_run); |
| 177 | |
| 178 | // Add specific files if provided |
| 179 | if !self.files.is_empty() { |
| 180 | options = options.paths(self.files.clone()); |
| 181 | } |
| 182 | |
| 183 | // Set max size if provided |
| 184 | if let Some(max_size) = self.max_size { |
| 185 | options = options.with_max_file_size(max_size); |
| 186 | } |
| 187 | |
| 188 | // Add AI provenance if enabled |
| 189 | if let Some(provenance) = self.build_provenance() { |
| 190 | options = options.add_provenance(provenance); |
| 191 | } |
| 192 | |
| 193 | Ok(options) |
| 194 | } |
| 195 | } |