Build RecordOptions from command-line arguments.
(&self)
| 92 | |
| 93 | /// Build RecordOptions from command-line arguments. |
| 94 | pub(super) fn build_options(&self) -> CliResult<RecordOptions> { |
| 95 | let algorithm = self.parse_algorithm()?; |
| 96 | |
| 97 | let mut options = RecordOptions::new() |
| 98 | .with_all(self.all) |
| 99 | .include_untracked(self.all) |
| 100 | .with_algorithm(algorithm) |
| 101 | .with_skip_binary(self.skip_binary) |
| 102 | .allow_conflict_markers(self.allow_conflict_markers) |
| 103 | .resolve_name_conflicts(self.resolve_name_conflicts.clone()) |
| 104 | .apply_after_record(!self.dry_run) |
| 105 | .save_to_store(!self.dry_run); |
| 106 | |
| 107 | // Add specific files if provided |
| 108 | if !self.files.is_empty() { |
| 109 | options = options.paths(self.files.clone()); |
| 110 | } |
| 111 | |
| 112 | // Set max size if provided |
| 113 | if let Some(max_size) = self.max_size { |
| 114 | options = options.with_max_file_size(max_size); |
| 115 | } |
| 116 | |
| 117 | // Add AI provenance if enabled |
| 118 | if let Some(provenance) = self.build_provenance() { |
| 119 | options = options.add_provenance(provenance); |
| 120 | } |
| 121 | |
| 122 | Ok(options) |
| 123 | } |
| 124 | } |