Parse the algorithm string into an Algorithm enum.
(&self)
| 182 | |
| 183 | /// Parse the algorithm string into an Algorithm enum. |
| 184 | pub(crate) fn parse_algorithm(&self) -> CliResult<Algorithm> { |
| 185 | self.algorithm |
| 186 | .parse() |
| 187 | .map_err(|_| CliError::InvalidArgument { |
| 188 | message: format!( |
| 189 | "unknown diff algorithm '{}'. Valid options: myers, patience", |
| 190 | self.algorithm |
| 191 | ), |
| 192 | }) |
| 193 | } |
| 194 | |
| 195 | /// Create a DiffOutputConfig from the command settings. |
| 196 | pub(crate) fn get_output_config(&self) -> DiffOutputConfig { |