taraskevizer 9.2.2 → 9.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +29 -30
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -1,61 +1,60 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { dicts, TaraskConfig, tarask, pipelines, htmlConfigOptions, wrappers, } from './index.js';
|
|
3
|
-
const prefix = '\x1b[34m[taraskevizer]\x1b[0m ';
|
|
4
3
|
const printWithPrefix = (msg) => {
|
|
5
|
-
process.stdout.write(
|
|
4
|
+
process.stdout.write("[34m[taraskevizer][0m" + msg + '\n');
|
|
6
5
|
};
|
|
7
6
|
process.argv.splice(0, 2);
|
|
8
7
|
const checkForOptions = (options) => process.argv[0] && options.includes(process.argv[0].toLowerCase());
|
|
9
8
|
if (checkForOptions(['-v', '--version'])) {
|
|
10
|
-
printWithPrefix("9.2.
|
|
9
|
+
printWithPrefix("9.2.3");
|
|
11
10
|
process.exit(0);
|
|
12
11
|
}
|
|
13
12
|
if (checkForOptions(['-h', '--help'])) {
|
|
14
|
-
printWithPrefix(`Usage:
|
|
13
|
+
printWithPrefix(`Usage: [34mtarask[0m [options] text
|
|
15
14
|
If text is not passed, interactive mode will be enabled
|
|
16
15
|
|
|
17
16
|
EXAMPLES
|
|
18
17
|
|
|
19
18
|
Convert and latinize a word
|
|
20
|
-
|
|
21
|
-
Will print "p
|
|
19
|
+
[34mtarask[0m [35m--latin[0m 'планета'
|
|
20
|
+
Will print "p[32ml[0ma[32mne[0mta"
|
|
22
21
|
|
|
23
22
|
Read from one file and write converted text to another
|
|
24
|
-
|
|
23
|
+
[34mtarask[0m < ./cyr-text.txt > ./lat-text.txt
|
|
25
24
|
|
|
26
25
|
Enter interactive mode
|
|
27
|
-
|
|
28
|
-
Will print "[taraskevizer] Enter the text:" and wait until you press Enter
|
|
26
|
+
[34mtarask[0m
|
|
27
|
+
Will print "[34m[taraskevizer][0m Enter the text:" and wait until you press Enter
|
|
29
28
|
|
|
30
29
|
OPTIONS
|
|
31
30
|
|
|
32
|
-
|
|
33
|
-
-h --help
|
|
34
|
-
-v --version
|
|
31
|
+
[33mGeneral[0m:
|
|
32
|
+
[35m-h[0m [35m--help[0m
|
|
33
|
+
[35m-v[0m [35m--version[0m
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
-l --latin
|
|
38
|
-
-lj --latin-ji
|
|
39
|
-
-a --arabic
|
|
35
|
+
[33mAlphabet[0m:
|
|
36
|
+
[35m-l[0m [35m--latin[0m
|
|
37
|
+
[35m-lj[0m [35m--latin-ji[0m
|
|
38
|
+
[35m-a[0m [35m--arabic[0m
|
|
40
39
|
|
|
41
|
-
|
|
42
|
-
-jr --jrandom
|
|
43
|
-
-ja --jalways
|
|
40
|
+
[33mWhen to replace і(i) by й(j) after vowels[0m:
|
|
41
|
+
[35m-jr[0m [35m--jrandom[0m
|
|
42
|
+
[35m-ja[0m [35m--jalways[0m
|
|
44
43
|
|
|
45
|
-
|
|
46
|
-
--h
|
|
44
|
+
[33mReplace ґ(g) by г(h) in cyrillic alphabet[0m:
|
|
45
|
+
[35m--h[0m
|
|
47
46
|
|
|
48
|
-
|
|
49
|
-
-nv --no-variations
|
|
50
|
-
-fv --first-variation
|
|
47
|
+
[33mVariations[0m:
|
|
48
|
+
[35m-nv[0m [35m--no-variations[0m
|
|
49
|
+
[35m-fv[0m [35m--first-variation[0m
|
|
51
50
|
|
|
52
|
-
|
|
53
|
-
-html --html
|
|
54
|
-
-abc --alphabet-only
|
|
51
|
+
[33mMode (only one can be used)[0m:
|
|
52
|
+
[35m-html[0m [35m--html[0m
|
|
53
|
+
[35m-abc[0m [35m--alphabet-only[0m
|
|
55
54
|
|
|
56
|
-
|
|
57
|
-
-nec --not-escape-caps
|
|
58
|
-
-nc --no-color
|
|
55
|
+
[33mOther[0m:
|
|
56
|
+
[35m-nec[0m [35m--not-escape-caps[0m
|
|
57
|
+
[35m-nc[0m [35m--no-color[0m
|
|
59
58
|
`);
|
|
60
59
|
process.exit(0);
|
|
61
60
|
}
|