Parse the algorithm string into an Algorithm enum.
(&self)
| 236 | |
| 237 | /// Parse the algorithm string into an Algorithm enum. |
| 238 | pub(crate) fn parse_algorithm(&self) -> CliResult<Algorithm> { |
| 239 | self.algorithm |
| 240 | .parse() |
| 241 | .map_err(|_| CliError::InvalidArgument { |
| 242 | message: format!( |
| 243 | "unknown diff algorithm '{}'. Valid options: myers, patience", |
| 244 | self.algorithm |
| 245 | ), |
| 246 | }) |
| 247 | } |
| 248 | |
| 249 | /// Create a DiffOutputConfig from the command settings. |
| 250 | pub(crate) fn get_output_config(&self) -> DiffOutputConfig { |