@bablr/cli 0.1.9 → 0.1.11
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/README.md +2 -2
- package/bin/index.js +4 -8
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -12,11 +12,11 @@ Usage: bablr [options]
|
|
|
12
12
|
Options:
|
|
13
13
|
-l, --language [URL] The URL of the top BABLR language
|
|
14
14
|
-p, --production [type] The name of the top production type
|
|
15
|
-
-F, --no-format Produce machine-readable CSTML output
|
|
16
15
|
-f, --format Pretty-format CSTML output (default: true)
|
|
16
|
+
-F, --no-format
|
|
17
17
|
-v, --verbose Prints debugging information to stderr
|
|
18
18
|
-c, --color [WHEN] When to use ANSI escape colors
|
|
19
|
-
WHEN: auto | always | never (default: "auto")
|
|
19
|
+
WHEN: "auto" | "always" | "never" (default: "auto")
|
|
20
20
|
-e, --embedded Requires quoted input but enables gap parsing
|
|
21
21
|
-h, --help display help for command
|
|
22
22
|
```
|
package/bin/index.js
CHANGED
|
@@ -17,12 +17,12 @@ import { writeLinesToWritableStream } from '../lib/utils/node.js';
|
|
|
17
17
|
program
|
|
18
18
|
.option('-l, --language [URL]', 'The URL of the top BABLR language')
|
|
19
19
|
.option('-p, --production [type]', 'The name of the top production type')
|
|
20
|
-
.option('-F, --no-format', 'Produce machine-readable CSTML output')
|
|
21
20
|
.option('-f, --format', 'Pretty-format CSTML output', true)
|
|
21
|
+
.option('-F, --no-format')
|
|
22
22
|
.option('-v, --verbose', 'Prints debugging information to stderr')
|
|
23
23
|
.option(
|
|
24
24
|
'-c, --color [WHEN]',
|
|
25
|
-
'When to use ANSI escape colors
|
|
25
|
+
'When to use ANSI escape colors \n WHEN: "auto" | "always" | "never"',
|
|
26
26
|
'auto',
|
|
27
27
|
)
|
|
28
28
|
.option('-e, --embedded', 'Requires quoted input but enables gap parsing')
|
|
@@ -37,7 +37,7 @@ if (programOpts.color && !['auto', 'always', 'never'].includes(programOpts.color
|
|
|
37
37
|
const options = {
|
|
38
38
|
...programOpts,
|
|
39
39
|
color:
|
|
40
|
-
(programOpts.color.toLowerCase() === 'auto' && colorSupport.hasBasic) ||
|
|
40
|
+
(programOpts.color.toLowerCase() === 'auto' && colorSupport.hasBasic && !programOpts.verbose) ||
|
|
41
41
|
programOpts.color.toLowerCase() === 'always',
|
|
42
42
|
};
|
|
43
43
|
|
|
@@ -48,11 +48,7 @@ const logStderr = (...args) => {
|
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
if (options.verbose && options.color) {
|
|
51
|
-
|
|
52
|
-
// this means you NEED a parser that ingests a combination of log and output if you
|
|
53
|
-
// want to be able to highlight the complete output without breakage
|
|
54
|
-
// It can be built, but I haven't yet
|
|
55
|
-
throw new Error('Unsupported combination of options: verbose and color');
|
|
51
|
+
throw new Error('TODO support this in a better way than turning off color');
|
|
56
52
|
}
|
|
57
53
|
|
|
58
54
|
const enhancers = options.verbose ? { ...buildDebugEnhancers(logStderr), agastStrategy: null } : {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bablr/cli",
|
|
3
3
|
"description": "CLI for running BABLR parsers",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.11",
|
|
5
5
|
"author": "Conrad Buck<conartist6@gmail.com>",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@bablr/boot": "0.2.3",
|
|
24
24
|
"@bablr/coroutine": "0.1.0",
|
|
25
25
|
"@bablr/helpers": "0.15.4",
|
|
26
|
-
"@bablr/language-cstml": "0.2.
|
|
26
|
+
"@bablr/language-cstml": "0.2.4",
|
|
27
27
|
"bablr": "0.1.3",
|
|
28
28
|
"color-support": "1.1.3",
|
|
29
29
|
"commander": "12.0.0"
|