| 27 | }; |
| 28 | |
| 29 | const throwHelpError = (option: string, value: string) => { |
| 30 | if (value === "help") { |
| 31 | openUrl("/go/call"); |
| 32 | } |
| 33 | |
| 34 | // Better error message for invalid locale or bucket format inputs, with instructions to get help for supported formats |
| 35 | throw new Error( |
| 36 | `Invalid ${option}: "${value}".\n\n` + |
| 37 | `Accepted formats:\n` + |
| 38 | ` es,fr\n` + |
| 39 | ` es fr\n` + |
| 40 | ` 'es', 'fr'\n\n` + |
| 41 | `If you need support for "${value}" ${option}, type "help" and we will.`, |
| 42 | ); |
| 43 | }; |
| 44 | |
| 45 | // Parses comma or space separated list of values, removing extra whitespace and quotes |
| 46 | export const parseListInput = (value: string): string[] => |