(options: {
readonly?: boolean;
auto?: boolean;
allow?: string[];
ask?: string[];
exclude?: string[];
})
| 62 | * Eliminates duplication and provides single source of truth for flag processing |
| 63 | */ |
| 64 | export function processCommandFlags(options: { |
| 65 | readonly?: boolean; |
| 66 | auto?: boolean; |
| 67 | allow?: string[]; |
| 68 | ask?: string[]; |
| 69 | exclude?: string[]; |
| 70 | }): ProcessedFlags { |
| 71 | // Convert legacy flags to mode |
| 72 | const mode = convertLegacyModeFlags(options.readonly, options.auto); |
| 73 | |
| 74 | // Build permission overrides |
| 75 | const permissionOverrides = buildPermissionOverrides( |
| 76 | options.allow, |
| 77 | options.ask, |
| 78 | options.exclude, |
| 79 | mode, |
| 80 | ); |
| 81 | |
| 82 | return { |
| 83 | mode, |
| 84 | permissionOverrides, |
| 85 | }; |
| 86 | } |
no test coverage detected