There was an error while loading. Please reload this page.
1 parent 7803d91 commit 16e3068Copy full SHA for 16e3068
1 file changed
packages/commands/src/commands/speech/vocabulary/shared.ts
@@ -1,6 +1,7 @@
1
import {
2
readTextFromPathOrStdin,
3
parseVocabularyEntries,
4
+ UsageError,
5
type FlagsDef,
6
type ParsedFlags,
7
type VocabularyEntry,
@@ -61,6 +62,17 @@ export function validateVocabularySource(flags: VocabularySourceFlags): string |
61
62
if (flags.words && flags.wordsFile) {
63
return "Use either --words or --words-file, not both.";
64
}
65
+ if (!flags.words) {
66
+ return undefined;
67
+ }
68
+ try {
69
+ parseVocabularyEntries(flags.words, flags.lang);
70
+ } catch (error) {
71
+ if (error instanceof UsageError) {
72
+ return error.message;
73
74
+ throw error;
75
76
return undefined;
77
78
0 commit comments