Get the output format based on command flags.
(&self)
| 165 | |
| 166 | /// Get the output format based on command flags. |
| 167 | pub fn get_format(&self) -> DiffFormat { |
| 168 | if self.name_only { |
| 169 | DiffFormat::NameOnly |
| 170 | } else if self.name_status || self.short { |
| 171 | DiffFormat::NameStatus |
| 172 | } else if self.stat { |
| 173 | DiffFormat::Stat |
| 174 | } else { |
| 175 | DiffFormat::Unified |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | /// Parse the algorithm string into an Algorithm enum. |
| 180 | pub(crate) fn parse_algorithm(&self) -> CliResult<Algorithm> { |