@optique/logtape 1.0.0-dev.1390 → 1.0.0-dev.1400
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/index.cjs +6 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -26,6 +26,7 @@ const __optique_core_primitives = __toESM(require("@optique/core/primitives"));
|
|
|
26
26
|
const __optique_core_modifiers = __toESM(require("@optique/core/modifiers"));
|
|
27
27
|
const __optique_core_message = __toESM(require("@optique/core/message"));
|
|
28
28
|
const node_path = __toESM(require("node:path"));
|
|
29
|
+
const __optique_core_nonempty = __toESM(require("@optique/core/nonempty"));
|
|
29
30
|
const __optique_core_constructs = __toESM(require("@optique/core/constructs"));
|
|
30
31
|
|
|
31
32
|
//#region src/loglevel.ts
|
|
@@ -219,11 +220,14 @@ function debug(options = {}) {
|
|
|
219
220
|
*
|
|
220
221
|
* @param options Configuration options for the parser.
|
|
221
222
|
* @returns A {@link ValueParser} that produces a {@link LogOutput}.
|
|
223
|
+
* @throws {TypeError} If `options.metavar` is an empty string.
|
|
222
224
|
*/
|
|
223
225
|
function logOutputValueParser(options = {}) {
|
|
226
|
+
const metavar = options.metavar ?? "FILE";
|
|
227
|
+
(0, __optique_core_nonempty.ensureNonEmptyString)(metavar);
|
|
224
228
|
return {
|
|
225
229
|
$mode: "sync",
|
|
226
|
-
metavar
|
|
230
|
+
metavar,
|
|
227
231
|
parse(input) {
|
|
228
232
|
if (input === "-") return {
|
|
229
233
|
success: true,
|
|
@@ -266,6 +270,7 @@ function logOutputValueParser(options = {}) {
|
|
|
266
270
|
*
|
|
267
271
|
* @param options Configuration options for the log output parser.
|
|
268
272
|
* @returns A {@link Parser} that produces a {@link LogOutput} or `undefined`.
|
|
273
|
+
* @throws {TypeError} If `options.metavar` is an empty string.
|
|
269
274
|
*
|
|
270
275
|
* @example Basic usage
|
|
271
276
|
* ```typescript
|
package/dist/index.d.cts
CHANGED
|
@@ -288,6 +288,7 @@ interface LogOutputOptions {
|
|
|
288
288
|
*
|
|
289
289
|
* @param options Configuration options for the log output parser.
|
|
290
290
|
* @returns A {@link Parser} that produces a {@link LogOutput} or `undefined`.
|
|
291
|
+
* @throws {TypeError} If `options.metavar` is an empty string.
|
|
291
292
|
*
|
|
292
293
|
* @example Basic usage
|
|
293
294
|
* ```typescript
|
package/dist/index.d.ts
CHANGED
|
@@ -288,6 +288,7 @@ interface LogOutputOptions {
|
|
|
288
288
|
*
|
|
289
289
|
* @param options Configuration options for the log output parser.
|
|
290
290
|
* @returns A {@link Parser} that produces a {@link LogOutput} or `undefined`.
|
|
291
|
+
* @throws {TypeError} If `options.metavar` is an empty string.
|
|
291
292
|
*
|
|
292
293
|
* @example Basic usage
|
|
293
294
|
* ```typescript
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import { flag, option } from "@optique/core/primitives";
|
|
|
3
3
|
import { map, multiple, optional, withDefault } from "@optique/core/modifiers";
|
|
4
4
|
import { message } from "@optique/core/message";
|
|
5
5
|
import { basename } from "node:path";
|
|
6
|
+
import { ensureNonEmptyString } from "@optique/core/nonempty";
|
|
6
7
|
import { group, object } from "@optique/core/constructs";
|
|
7
8
|
|
|
8
9
|
//#region src/loglevel.ts
|
|
@@ -196,11 +197,14 @@ function debug(options = {}) {
|
|
|
196
197
|
*
|
|
197
198
|
* @param options Configuration options for the parser.
|
|
198
199
|
* @returns A {@link ValueParser} that produces a {@link LogOutput}.
|
|
200
|
+
* @throws {TypeError} If `options.metavar` is an empty string.
|
|
199
201
|
*/
|
|
200
202
|
function logOutputValueParser(options = {}) {
|
|
203
|
+
const metavar = options.metavar ?? "FILE";
|
|
204
|
+
ensureNonEmptyString(metavar);
|
|
201
205
|
return {
|
|
202
206
|
$mode: "sync",
|
|
203
|
-
metavar
|
|
207
|
+
metavar,
|
|
204
208
|
parse(input) {
|
|
205
209
|
if (input === "-") return {
|
|
206
210
|
success: true,
|
|
@@ -243,6 +247,7 @@ function logOutputValueParser(options = {}) {
|
|
|
243
247
|
*
|
|
244
248
|
* @param options Configuration options for the log output parser.
|
|
245
249
|
* @returns A {@link Parser} that produces a {@link LogOutput} or `undefined`.
|
|
250
|
+
* @throws {TypeError} If `options.metavar` is an empty string.
|
|
246
251
|
*
|
|
247
252
|
* @example Basic usage
|
|
248
253
|
* ```typescript
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@optique/logtape",
|
|
3
|
-
"version": "1.0.0-dev.
|
|
3
|
+
"version": "1.0.0-dev.1400+437307fc",
|
|
4
4
|
"description": "LogTape logging integration for Optique CLI parser",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"CLI",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@optique/core": "1.0.0-dev.
|
|
66
|
+
"@optique/core": "1.0.0-dev.1400+437307fc"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@logtape/file": "^2.0.4",
|