@optique/logtape 0.9.0-dev.191 → 0.9.0-dev.196
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 +5 -4
- package/dist/index.js +5 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -148,7 +148,7 @@ function verbosity(options = {}) {
|
|
|
148
148
|
const baseLevel = options.baseLevel ?? "warning";
|
|
149
149
|
const baseIndex = VERBOSITY_LEVELS.indexOf(baseLevel);
|
|
150
150
|
const effectiveBaseIndex = baseIndex >= 0 ? baseIndex : WARNING_INDEX;
|
|
151
|
-
const flagParser = (0, __optique_core_primitives.flag)(short, long, { description: options.description });
|
|
151
|
+
const flagParser = (0, __optique_core_primitives.flag)(short, long, { description: options.description ?? __optique_core_message.message`Be more verbose. Can be repeated.` });
|
|
152
152
|
const multipleFlags = (0, __optique_core_modifiers.multiple)(flagParser);
|
|
153
153
|
return (0, __optique_core_modifiers.map)(multipleFlags, (flags) => {
|
|
154
154
|
const count = flags.length;
|
|
@@ -201,7 +201,7 @@ function debug(options = {}) {
|
|
|
201
201
|
const long = options.long ?? "--debug";
|
|
202
202
|
const debugLevel = options.debugLevel ?? "debug";
|
|
203
203
|
const normalLevel = options.normalLevel ?? "info";
|
|
204
|
-
const flagParser = (0, __optique_core_primitives.flag)(short, long, { description: options.description });
|
|
204
|
+
const flagParser = (0, __optique_core_primitives.flag)(short, long, { description: options.description ?? __optique_core_message.message`Enable debug logging.` });
|
|
205
205
|
return (0, __optique_core_modifiers.map)((0, __optique_core_modifiers.optional)(flagParser), (value) => {
|
|
206
206
|
return value === true ? debugLevel : normalLevel;
|
|
207
207
|
});
|
|
@@ -282,11 +282,12 @@ function logOutputValueParser(options = {}) {
|
|
|
282
282
|
function logOutput(options = {}) {
|
|
283
283
|
const long = options.long ?? "--log-output";
|
|
284
284
|
const valueParser = logOutputValueParser(options);
|
|
285
|
+
const description = options.description ?? __optique_core_message.message`Log output destination. Use ${"-"} for console.`;
|
|
285
286
|
if (options.short) {
|
|
286
287
|
const short = options.short;
|
|
287
|
-
return (0, __optique_core_modifiers.optional)((0, __optique_core_primitives.option)(short, long, valueParser, { description
|
|
288
|
+
return (0, __optique_core_modifiers.optional)((0, __optique_core_primitives.option)(short, long, valueParser, { description }));
|
|
288
289
|
}
|
|
289
|
-
return (0, __optique_core_modifiers.optional)((0, __optique_core_primitives.option)(long, valueParser, { description
|
|
290
|
+
return (0, __optique_core_modifiers.optional)((0, __optique_core_primitives.option)(long, valueParser, { description }));
|
|
290
291
|
}
|
|
291
292
|
/**
|
|
292
293
|
* Creates a console sink with configurable stream selection.
|
package/dist/index.js
CHANGED
|
@@ -125,7 +125,7 @@ function verbosity(options = {}) {
|
|
|
125
125
|
const baseLevel = options.baseLevel ?? "warning";
|
|
126
126
|
const baseIndex = VERBOSITY_LEVELS.indexOf(baseLevel);
|
|
127
127
|
const effectiveBaseIndex = baseIndex >= 0 ? baseIndex : WARNING_INDEX;
|
|
128
|
-
const flagParser = flag(short, long, { description: options.description });
|
|
128
|
+
const flagParser = flag(short, long, { description: options.description ?? message`Be more verbose. Can be repeated.` });
|
|
129
129
|
const multipleFlags = multiple(flagParser);
|
|
130
130
|
return map(multipleFlags, (flags) => {
|
|
131
131
|
const count = flags.length;
|
|
@@ -178,7 +178,7 @@ function debug(options = {}) {
|
|
|
178
178
|
const long = options.long ?? "--debug";
|
|
179
179
|
const debugLevel = options.debugLevel ?? "debug";
|
|
180
180
|
const normalLevel = options.normalLevel ?? "info";
|
|
181
|
-
const flagParser = flag(short, long, { description: options.description });
|
|
181
|
+
const flagParser = flag(short, long, { description: options.description ?? message`Enable debug logging.` });
|
|
182
182
|
return map(optional(flagParser), (value) => {
|
|
183
183
|
return value === true ? debugLevel : normalLevel;
|
|
184
184
|
});
|
|
@@ -259,11 +259,12 @@ function logOutputValueParser(options = {}) {
|
|
|
259
259
|
function logOutput(options = {}) {
|
|
260
260
|
const long = options.long ?? "--log-output";
|
|
261
261
|
const valueParser = logOutputValueParser(options);
|
|
262
|
+
const description = options.description ?? message`Log output destination. Use ${"-"} for console.`;
|
|
262
263
|
if (options.short) {
|
|
263
264
|
const short = options.short;
|
|
264
|
-
return optional(option(short, long, valueParser, { description
|
|
265
|
+
return optional(option(short, long, valueParser, { description }));
|
|
265
266
|
}
|
|
266
|
-
return optional(option(long, valueParser, { description
|
|
267
|
+
return optional(option(long, valueParser, { description }));
|
|
267
268
|
}
|
|
268
269
|
/**
|
|
269
270
|
* Creates a console sink with configurable stream selection.
|