taraskevizer 10.1.2 → 10.1.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.
Files changed (2) hide show
  1. package/dist/bin.js +10 -9
  2. package/package.json +1 -1
package/dist/bin.js CHANGED
@@ -4,13 +4,14 @@ const printWithPrefix = (msg) => {
4
4
  process.stdout.write("[taraskevizer]" + ' ' + msg + '\n');
5
5
  };
6
6
  process.argv.splice(0, 2);
7
- const checkForOptions = (options) => process.argv[0] && options.includes(process.argv[0].toLowerCase());
8
- if (checkForOptions(['-v', '--version'])) {
9
- printWithPrefix("10.1.2");
10
- process.exit(0);
11
- }
12
- if (checkForOptions(['-h', '--help'])) {
13
- printWithPrefix(`Usage: tarask [options] text
7
+ const firstArg = process.argv[0];
8
+ if (firstArg) {
9
+ if (firstArg === '-v' || firstArg === '--version') {
10
+ printWithPrefix("10.1.3");
11
+ process.exit(0);
12
+ }
13
+ if (firstArg === '-h' || firstArg === '--help') {
14
+ printWithPrefix(`Usage: tarask [options] text
14
15
  If text is not passed, interactive mode will be enabled
15
16
 
16
17
  EXAMPLES
@@ -56,7 +57,8 @@ OPTIONS
56
57
  -nec --not-escape-caps
57
58
  -nc --no-color
58
59
  `);
59
- process.exit(0);
60
+ process.exit(0);
61
+ }
60
62
  }
61
63
  let cfg = {
62
64
  g: true,
@@ -73,7 +75,6 @@ const toHashTable = (dict) => {
73
75
  };
74
76
  let isHtml = false;
75
77
  const optionDict = toHashTable([
76
- [['--help', '-h'], () => { }],
77
78
  [
78
79
  ['--latin', '-l'],
79
80
  () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taraskevizer",
3
- "version": "10.1.2",
3
+ "version": "10.1.3",
4
4
  "author": "GooseOb",
5
5
  "repository": {
6
6
  "type": "git",