Validates the optional short alias for one suite-defined option.
(&self)
| 308 | |
| 309 | /// Validates the optional short alias for one suite-defined option. |
| 310 | fn validate_short_alias(&self) -> Result<()> { |
| 311 | let Some(short) = &self.short else { |
| 312 | return Ok(()); |
| 313 | }; |
| 314 | |
| 315 | if short.trim().is_empty() { |
| 316 | return Err(DataFusionError::Configuration(format!( |
| 317 | "short alias for option '{}' cannot be empty", |
| 318 | self.name |
| 319 | ))); |
| 320 | } |
| 321 | |
| 322 | if !is_valid_cli_option_name(short) { |
| 323 | return Err(DataFusionError::Configuration(format!( |
| 324 | "invalid short alias '{short}' for option '{}'; expected lowercase ASCII letters, digits, and hyphens", |
| 325 | self.name |
| 326 | ))); |
| 327 | } |
| 328 | |
| 329 | Ok(()) |
| 330 | } |
| 331 | } |
| 332 | |
| 333 | impl SuiteRegistry { |
no test coverage detected