(options: ValidationOptions)
| 183 | * Run all validation checks on the provided options |
| 184 | */ |
| 185 | export function validateFlags(options: ValidationOptions): ValidationResult { |
| 186 | const allErrors: ValidationError[] = []; |
| 187 | |
| 188 | // Run all validation functions |
| 189 | const validators = [ |
| 190 | validateFormatFlag, |
| 191 | validateSilentFlag, |
| 192 | validateFormatValue, |
| 193 | validateModeFlags, |
| 194 | validateSessionFlags, |
| 195 | validateConfigPath, |
| 196 | validatePermissionFlags, |
| 197 | ]; |
| 198 | |
| 199 | for (const validator of validators) { |
| 200 | allErrors.push(...validator(options)); |
| 201 | } |
| 202 | |
| 203 | return { |
| 204 | isValid: allErrors.length === 0, |
| 205 | errors: allErrors, |
| 206 | }; |
| 207 | } |
| 208 | |
| 209 | /** |
| 210 | * Display validation errors and exit process |
no test coverage detected