()
| 25 | * @returns Validator function for Commander option parsing |
| 26 | */ |
| 27 | export function createBlockTypeValidator(): (value: string) => FilterableBlockType { |
| 28 | return (value: string): FilterableBlockType => { |
| 29 | if (!FILTERABLE_BLOCK_TYPES.includes(value as FilterableBlockType)) { |
| 30 | throw new InvalidArgumentError(`Invalid block type "${value}". Valid types: ${FILTERABLE_BLOCK_TYPES.join(', ')}`) |
| 31 | } |
| 32 | return value as FilterableBlockType |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | export interface CatOptions { |
| 37 | output?: OutputFormat |